/*
  Plantvu Clarity — ERPNext DESK overlay (Orders / Inventory / Quality / Accounts /
  Manufacturing — every desk module).

  Loaded via app_include_css (plantvu app) AFTER core Frappe CSS, so plain
  :root / [data-theme="dark"] variable overrides win by source order — no
  !important needed except the §3 radius rules (those fight Sass-compiled
  literals). Mirrors the teal ramp from plantvu_connect/frontend/src/clarity.css
  so Desk + Connect + CRM share one accent (change a hex there, change it here).

  v16 NOTE (load-bearing): the desk accent is GRAY-anchored, not blue —
  --primary-color/--btn-primary/--brand-color default to gray-900. Repointing
  --blue-* alone only retints info badges; the real accent levers are the
  --primary* family below. Status pills (.indicator-pill.{color}) already use
  the soft wash+ink model (--bg-{color} + --text-on-{color}) — Clarity status
  is a retint, not a rebuild.

  Out of scope by design (separate deliverables): print/PDF formats, chart
  palettes (frappe-charts SVG arrays), inline-styled widgets, the CRM SPA
  interior (themed in the plantvu_crm fork), portal/website pages.
*/

/* ---- TEAL RAMP + RADII (single source of truth, both modes read these) ---- */
:root {
  --pv-clarity-build: 'clarity-desk-v3';

  --pv-teal-50: #f0fdfa;
  --pv-teal-100: #e6f7f4;
  --pv-teal-200: #bae8e1;
  --pv-teal-300: #97ded4;
  --pv-teal-400: #73d1c4;
  --pv-teal-500: #36baad;
  --pv-teal-600: #0b9e92; /* Plantvu brand accent */
  --pv-teal-700: #0f736b;
  --pv-teal-800: #115c57;
  --pv-teal-900: #114541;

  /* iOS radius bump — mirrors Connect tailwind.config.js borderRadius */
  --pv-radius-sm: 0.375rem;
  --pv-radius: 0.5rem;
  --pv-radius-md: 0.625rem;
  --pv-radius-lg: 0.75rem;
  --pv-radius-xl: 1rem;
}

/* =====================================================================
   1. LIGHT — accent, radii, soft status pills
   ===================================================================== */
:root,
[data-theme='light'] {
  /* accent: repoint v16's gray-anchored primary onto teal */
  --primary: var(--pv-teal-600);
  --primary-color: var(--pv-teal-600);
  --brand-color: var(--pv-teal-600);
  --btn-primary: var(--pv-teal-600);
  --border-primary: var(--pv-teal-600);
  --checkbox-color: var(--pv-teal-600);
  --checkbox-focus-shadow: 0 0 0 2px var(--pv-teal-200);
  --switch-bg: var(--pv-teal-500);

  /* some desk components reference the raw blue ramp directly
     (links, focus rings, info chips) — retint it to teal */
  --blue-50: var(--pv-teal-50);
  --blue-100: var(--pv-teal-100);
  --blue-200: var(--pv-teal-200);
  --blue-300: var(--pv-teal-300);
  --blue-400: var(--pv-teal-400);
  --blue-500: var(--pv-teal-500);
  --blue-600: var(--pv-teal-600);
  --blue-700: var(--pv-teal-700);
  --blue-800: var(--pv-teal-800);
  --blue-900: var(--pv-teal-900);

  /* radius bump (the CSS-var-driven radii) */
  --border-radius: var(--pv-radius);
  --border-radius-sm: var(--pv-radius-sm);
  --border-radius-md: var(--pv-radius-md);
  --border-radius-lg: var(--pv-radius-lg);
  --border-radius-full: 9999px;

  /* SOFT STATUS PILLS — .indicator-pill.{color} reads --bg-{color} (wash)
     + --text-on-{color} (glyph/label). Tints/inks = frappe-ui ramp values,
     identical to Connect's StatusBadge pairs. */
  --bg-green: #e4faeb;
  --text-on-green: #137949; /* Done / Approved / Pass        */
  --bg-orange: #fff7d3;
  --text-on-orange: #b35309; /* In Progress / Pending / Hold  */
  --bg-yellow: #fff7d3;
  --text-on-yellow: #b35309;
  --bg-red: #ffe7e7;
  --text-on-red: #b52a2a; /* Canceled / Failed / Overdue   */
  --bg-gray: #f3f3f3;
  --text-on-gray: #525252; /* Draft / Backlog / Open        */
  --bg-grey: #f3f3f3;
  --text-on-grey: #525252;
  --bg-blue: var(--pv-teal-100);
  --text-on-blue: var(--pv-teal-700); /* Submitted / info -> teal */
  --bg-cyan: var(--pv-teal-100);
  --text-on-cyan: var(--pv-teal-700);
  --bg-light-blue: var(--pv-teal-50);
  --text-on-light-blue: var(--pv-teal-700);
  /* frappe re-declares these three in a later desk bundle — !important needed */
  --bg-pink: #fce7f3 !important;
  --text-on-pink: #be185d !important;
  --bg-purple: #f3e8ff !important;
  --text-on-purple: #7e22ce !important;
  --bg-darkgrey: #e5e5e5 !important;
  --text-on-darkgrey: #404040 !important;

  --indicator-dot-green: #46b37e;
  --indicator-dot-orange: #e79913;
  --indicator-dot-yellow: #e79913;
  --indicator-dot-red: #e03636;
  --indicator-dot-gray: #999999;
  --indicator-dot-grey: #999999;
  --indicator-dot-blue: var(--pv-teal-500);
  --indicator-dot-cyan: var(--pv-teal-500);
  --indicator-dot-light-blue: var(--pv-teal-500);
  --indicator-dot-pink: #ec4899;
  --indicator-dot-purple: #a855f7;
  --indicator-dot-darkgrey: #737373;
}

/* =====================================================================
   2. DARK — same levers, dark teal ramp (brighter accent reads on dark);
   solid washes (not alpha) so pill contrast stays AA.
   ===================================================================== */
[data-theme='dark'] {
  --primary: var(--pv-teal-500);
  --primary-color: var(--pv-teal-500);
  --brand-color: var(--pv-teal-500);
  --btn-primary: var(--pv-teal-500);
  --border-primary: var(--pv-teal-500);
  --checkbox-color: var(--pv-teal-500);
  --checkbox-focus-shadow: 0 0 0 2px var(--pv-teal-800);
  --switch-bg: var(--pv-teal-500);

  --blue-50: #0a2d29;
  --blue-100: #0b3a35;
  --blue-200: #0c423c;
  --blue-300: #13564f;
  --blue-400: #1b7169;
  --blue-500: #219c8f;
  --blue-600: #3dc6b8;
  --blue-700: #52dacc;
  --blue-800: #6ee7db;
  --blue-900: #93f2e8;

  --border-radius: var(--pv-radius);
  --border-radius-sm: var(--pv-radius-sm);
  --border-radius-md: var(--pv-radius-md);
  --border-radius-lg: var(--pv-radius-lg);
  --border-radius-full: 9999px;

  /* soft pills on dark: deep solid wash + light ink (frappe-ui dark ramps) */
  --bg-green: #0b2e1c;
  --text-on-green: #58c08e;
  --bg-orange: #371e06;
  --text-on-orange: #e79913;
  --bg-yellow: #371e06;
  --text-on-yellow: #e79913;
  --bg-red: #361515;
  --text-on-red: #eb4d52;
  --bg-gray: #2b2b2b;
  --text-on-gray: #afafaf;
  --bg-grey: #2b2b2b;
  --text-on-grey: #afafaf;
  --bg-blue: #0b3a35;
  --text-on-blue: #3dc6b8;
  --bg-cyan: #0b3a35;
  --text-on-cyan: #3dc6b8;
  --bg-light-blue: #0b3a35;
  --text-on-light-blue: #52dacc;
  --bg-pink: #3b1029 !important;
  --text-on-pink: #f472b6 !important;
  --bg-purple: #2a1352 !important;
  --text-on-purple: #c084fc !important;
  --bg-darkgrey: #383838 !important;
  --text-on-darkgrey: #c7c7c7 !important;

  --indicator-dot-green: #1ba964;
  --indicator-dot-orange: #e79913;
  --indicator-dot-yellow: #e79913;
  --indicator-dot-red: #e43838;
  --indicator-dot-gray: #717171;
  --indicator-dot-grey: #717171;
  --indicator-dot-blue: #219c8f;
  --indicator-dot-cyan: #219c8f;
  --indicator-dot-light-blue: #219c8f;
  --indicator-dot-pink: #db2777;
  --indicator-dot-purple: #9333ea;
  --indicator-dot-darkgrey: #8a8a8a;
}

/* =====================================================================
   3. RADIUS — desk components whose radius is a Sass-compiled literal
   (not var-driven). Scoped to the usual offenders; trim/extend on QA.
   ===================================================================== */
.btn,
.form-control,
.input-with-feedback,
.search-bar input,
.awesomplete > input,
.indicator-pill,
.sidebar-item-container .item-anchor,
.list-row,
.dropdown-menu,
.frappe-control input,
.frappe-control select {
  border-radius: var(--pv-radius) !important;
}
.btn-sm,
.form-control-sm {
  border-radius: var(--pv-radius-sm) !important;
}
.frappe-card,
.widget,
.modal-content,
.form-grid {
  border-radius: var(--pv-radius-lg) !important;
}
.indicator-pill,
.indicator-pill-round {
  border-radius: var(--pv-radius-xl) !important; /* pills stay pill-shaped */
}

/* font parity with Connect (SF on Apple, else Inter/Segoe) */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto,
    system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =====================================================================
   4. iOS FORM FIELDS — the headline of Clarity v2. Filled inputs, soft
   hairline, teal focus glow, grouped section cards, iOS toggles. Quality /
   Sheet / People / Admin desk forms all inherit this automatically.

   Field tokens live here (both modes); §4/§5 read them. Inputs need
   !important to beat Frappe's Sass-compiled .form-control literals.
   ===================================================================== */
:root,
[data-theme='light'] {
  --pv-field-bg: #f4f6f8;
  --pv-field-bg-focus: #ffffff;
  --pv-field-border: #e3e6ec;
  --pv-field-border-hover: var(--pv-teal-300);
  --pv-glow: 0 0 0 3.5px rgba(11, 158, 146, 0.18);
  --pv-section-bg: #ffffff;
  --pv-section-border: #ebedf1;
  --pv-card-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.05);
  --pv-card-shadow-hover: 0 8px 24px rgba(11, 158, 146, 0.14);
  --pv-grad-primary: linear-gradient(180deg, #19ab9e 0%, #0b9e92 100%);
  --pv-grad-primary-hover: linear-gradient(180deg, #14a094 0%, #0a8c81 100%);
  --pv-grad-head: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
}
[data-theme='dark'] {
  /* Dark palette aligned to the landing page (plantvu/www/index.html): deep-navy
     surfaces with a LIGHTER card layer (#16223C over the page) for depth, bright
     teal #16E0B4 + cyan #2DD4FF accents, and teal-tinted elevation shadows so
     cards/tables read as raised — not the flat charcoal they were. */
  --pv-cyan: #2dd4ff;
  --pv-cyan-dark: #1796c4;
  --pv-field-bg: #111a2e;
  --pv-field-bg-focus: #16223c;
  --pv-field-border: #22304d;
  --pv-field-border-hover: #0fb89a;
  --pv-glow: 0 0 0 3.5px rgba(22, 224, 180, 0.28);
  --pv-section-bg: #16223c;
  --pv-section-border: #22304d;
  --pv-card-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(4, 9, 20, 0.5);
  --pv-card-shadow-hover: 0 12px 32px rgba(22, 224, 180, 0.2);
  --pv-grad-primary: linear-gradient(180deg, #16e0b4 0%, #0fb89a 100%);
  --pv-grad-primary-hover: linear-gradient(135deg, #2dd4ff 0%, #16e0b4 100%);
  --pv-grad-head: linear-gradient(180deg, #1a2742 0%, #16223c 100%);
}
/* Landing-page depth on dark cards/tables: a faint top highlight + the deep
   elevation shadow, so panels sit ABOVE the page rather than blending in. */
[data-theme='dark'] .widget,
[data-theme='dark'] .form-section.card-section,
[data-theme='dark'] .frappe-card,
[data-theme='dark'] .dashboard-card,
[data-theme='dark'] .form-dashboard-section,
[data-theme='dark'] .report-wrapper,
[data-theme='dark'] .list-row-container,
[data-theme='dark'] .ce-block__content {
  box-shadow: var(--pv-card-shadow);
  border: 1px solid var(--pv-section-border);
}
[data-theme='dark'] body,
[data-theme='dark'] .layout-main {
  background-image:
    radial-gradient(900px 480px at 82% -8%, rgba(22, 224, 180, 0.08), transparent 60%),
    radial-gradient(680px 420px at 4% 0%, rgba(45, 212, 255, 0.06), transparent 55%);
  background-attachment: fixed;
}

/* --- filled inputs ------------------------------------------------------- */
.form-control:not([type='checkbox']):not([type='radio']),
.input-with-feedback:not([type='checkbox']):not([type='radio']),
.frappe-control input[type='text'],
.frappe-control input[type='number'],
.frappe-control input[type='email'],
.frappe-control input[type='password'],
.frappe-control input[type='tel'],
.frappe-control input[type='date'],
.frappe-control input[type='datetime-local'],
.frappe-control textarea,
.frappe-control select,
.awesomplete > input,
.search-bar input {
  background-color: var(--pv-field-bg) !important;
  border: 1px solid var(--pv-field-border) !important;
  border-radius: var(--pv-radius-md) !important;
  padding: 0.46rem 0.7rem;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-appearance: none;
}
.form-control:hover:not(:focus):not([disabled]),
.input-with-feedback:hover:not(:focus),
.frappe-control textarea:hover:not(:focus),
.frappe-control select:hover:not(:focus),
.awesomplete > input:hover:not(:focus) {
  border-color: var(--pv-field-border-hover) !important;
}
.form-control:focus,
.input-with-feedback:focus,
.frappe-control input:focus,
.frappe-control textarea:focus,
.frappe-control select:focus,
.awesomplete > input:focus,
.search-bar input:focus {
  background-color: var(--pv-field-bg-focus) !important;
  border-color: var(--pv-teal-500) !important;
  box-shadow: var(--pv-glow) !important;
  outline: none !important;
}
/* Native <select> (Select fields, e.g. Customer Type) clip their value at the top
   on v16: appearance:none + our filled-input padding vs the base fixed height.
   Let the control grow to its content+padding and center the line. */
.frappe-control select,
select.input-with-feedback,
select.form-control {
  height: auto !important;
  min-height: 34px;
  line-height: 1.5 !important;
}

/* the read-only "value" rendering of link/data fields */
.like-disabled-input {
  background-color: var(--pv-field-bg) !important;
  border-radius: var(--pv-radius-md) !important;
}

/* --- labels: quieter iOS caption ---------------------------------------- */
.control-label,
.form-section .section-head,
.grid-heading-row .col {
  letter-spacing: 0.01em;
}
.control-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
}

/* --- grouped section cards (iOS Settings feel) -------------------------- */
.form-layout .form-section:not(.empty-section):not(.hide-control) {
  background: var(--pv-section-bg);
  border: 1px solid var(--pv-section-border);
  border-radius: var(--pv-radius-lg);
  padding: 0.4rem 1.1rem 0.7rem;
  margin: 0 0 0.85rem;
  box-shadow: var(--pv-card-shadow);
}
.form-section .section-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 0.3rem;
}

/* --- iOS toggle for Check fields (form context only, not list rows) -----
   Frappe v16 ships base rules `input[type='checkbox'] { width: var(--checkbox-size)
   !important }` and `:checked { background-color: var(--primary) }`, and our own
   filled-input rule sets bg + radius + padding on `.input-with-feedback` (which the
   checkbox carries). All of those collide with the toggle, so the size/shape/colour
   props below MUST be !important — our selector out-specifies the base rule, so with
   !important on both, ours wins and the pill renders. */
.frappe-control[data-fieldtype='Check'] .checkbox input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px !important;
  height: 22px !important;
  border-radius: 999px !important;
  background: var(--pv-field-border) !important;
  border: none !important;
  padding: 0 !important;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.18s ease;
  vertical-align: middle;
}
.frappe-control[data-fieldtype='Check'] .checkbox input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}
.frappe-control[data-fieldtype='Check'] .checkbox input[type='checkbox']:checked {
  background: var(--pv-teal-600) !important;
}
.frappe-control[data-fieldtype='Check'] .checkbox input[type='checkbox']:checked::after {
  transform: translateX(16px);
}
/* Layout: keep the wider 38px iOS toggle from overlapping the label. Frappe
   absolutely-positions .input-area at left:0 and reserves ~20px of label padding
   for the native ~14px checkbox, so the toggle clipped the first characters on
   dense ERPNext settings forms (Accounts Settings, etc.). Force a clean flex row
   [toggle] · [label] regardless of Frappe's base positioning. */
.frappe-control[data-fieldtype='Check'] .checkbox label {
  display: flex !important;
  align-items: center;
  padding-left: 0 !important;
  margin-bottom: 0;
  position: relative;
}
.frappe-control[data-fieldtype='Check'] .checkbox .input-area {
  position: static !important;
  left: auto !important;
  top: auto !important;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}
.frappe-control[data-fieldtype='Check'] .checkbox .label-area {
  flex: 1 1 auto;
  padding-left: 0 !important;
  margin-left: 10px !important;
  white-space: normal;
  line-height: 1.4;
}

/* --- iOS radio (form + dialog) -----------------------------------------
   Frappe v16's default Espresso theme asserts the SAME pattern on radios as
   on checkboxes — `input[type='radio']{ width:var(--checkbox-size)!important }`
   + `:checked::before{ background:var(--primary) }` — so a custom radio loses
   the cascade exactly like the checkbox toggle did. Out-specify + !important
   (background-COLOR longhand, to dodge the shorthand-vs-longhand trap), and
   hide v16's own ::before dot so it doesn't double up with our ::after. */
.frappe-control input[type='radio'],
.form-layout input[type='radio'],
.modal input[type='radio'] {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: relative;
  box-sizing: border-box;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  border: 2px solid var(--pv-field-border) !important;
  background-color: var(--pv-field-bg) !important;
  background-image: none !important;
  padding: 0 !important;
  cursor: pointer;
  vertical-align: middle;
}
.frappe-control input[type='radio']:checked,
.form-layout input[type='radio']:checked,
.modal input[type='radio']:checked {
  border-color: var(--pv-teal-600) !important;
  background-color: var(--pv-teal-600) !important;
}
.frappe-control input[type='radio']:checked::after,
.form-layout input[type='radio']:checked::after,
.modal input[type='radio']:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.frappe-control input[type='radio']::before,
.form-layout input[type='radio']::before,
.modal input[type='radio']::before {
  display: none !important;
}

/* =====================================================================
   5. EYE-CATCHING POLISH — gradient primary buttons with depth + press,
   card elevation + hover lift, teal sidebar selection, sticky form head.
   ===================================================================== */
.btn-primary,
.btn-modal-primary,
.page-actions .btn-primary,
.btn.btn-primary.btn-sm {
  background: var(--pv-grad-primary) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(11, 158, 146, 0.32),
    0 2px 8px rgba(11, 158, 146, 0.18);
  transition: box-shadow 0.15s ease, transform 0.08s ease, background 0.15s ease;
}
.btn-primary:hover,
.btn-modal-primary:hover {
  background: var(--pv-grad-primary-hover) !important;
  box-shadow: 0 2px 6px rgba(11, 158, 146, 0.4),
    0 6px 18px rgba(11, 158, 146, 0.26);
}
.btn-primary:active,
.btn-modal-primary:active {
  transform: translateY(0.5px) scale(0.99);
}

/* card / widget elevation + hover lift */
.widget.number-widget-box,
.widget.shortcut-widget-box,
.widget.links-widget-box,
.frappe-card {
  box-shadow: var(--pv-card-shadow);
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}
.widget.number-widget-box:hover,
.widget.shortcut-widget-box:hover,
.widget.links-widget-box:hover {
  box-shadow: var(--pv-card-shadow-hover);
  transform: translateY(-2px);
}

/* workspace + form sidebar: teal wash on the selected item */
.standard-sidebar-item.selected,
.sidebar-item-container.selected > .desk-sidebar-item,
.list-sidebar .list-link a.selected {
  background: var(--pv-teal-50);
  color: var(--pv-teal-700);
  font-weight: 600;
}
[data-theme='dark'] .standard-sidebar-item.selected,
[data-theme='dark'] .sidebar-item-container.selected > .desk-sidebar-item {
  background: #0b3a35;
  color: var(--pv-teal-600);
}

/* sticky form toolbar with a whisper of gradient + hairline */
.page-head {
  background: var(--pv-grad-head);
  border-bottom: 1px solid var(--pv-section-border);
}

/* primary shortcut numbers + links pick up the teal accent */
.widget.number-widget-box .widget-content .number {
  color: var(--pv-teal-700);
}

/* form grid (child tables): rounded, hairline rows */
.form-grid {
  border-radius: var(--pv-radius-lg) !important;
  overflow: hidden;
}
.form-grid .grid-heading-row {
  background: var(--pv-field-bg);
}

/* =====================================================================
   6. READABLE FIELD TEXT (contrast fix) — §4 pins field bg/border but never
   the *value* text color, so editable values inherited a low-contrast default
   and read-only / disabled fields (the "like-disabled" value Frappe renders
   for Link/Date/Select before focus) read grey-on-grey. Pin an explicit AA
   ink on every value rendering, both modes. -webkit-text-fill-color is
   required: browsers override `color` on [disabled] inputs with it.
   ===================================================================== */
:root,
[data-theme='light'] {
  --pv-field-ink: #1c2433;       /* AA on the #f4f6f8 filled field */
  --pv-field-ink-muted: #6b7280; /* placeholders / hints          */
}
[data-theme='dark'] {
  --pv-field-ink: #e7eef9;       /* light ink on the #111a2e field */
  --pv-field-ink-muted: #93a1b8;
}

/* every value rendering: live inputs, selects, textareas, the read-only
   "display" value, rich text/code editors, and child-table (grid) cells */
.form-control:not([type='checkbox']):not([type='radio']),
.input-with-feedback:not([type='checkbox']):not([type='radio']),
.frappe-control input,
.frappe-control textarea,
.frappe-control select,
.awesomplete > input,
.search-bar input,
.like-disabled-input,
.control-value,
.control-value.like-disabled-input,
.ql-editor,
.ace_editor,
.form-grid .grid-row .static-area,
.form-grid .grid-row .field-area,
.form-grid .grid-row input,
.grid-heading-row .col,
.multiselect .selected-value {
  color: var(--pv-field-ink) !important;
  -webkit-text-fill-color: var(--pv-field-ink) !important;
  opacity: 1 !important;
}

/* disabled / read-only fields keep full-contrast text, not browser grey */
.form-control[disabled],
.form-control[readonly],
.input-with-feedback[disabled],
.frappe-control input[disabled],
.frappe-control input[readonly],
.frappe-control select[disabled],
.frappe-control textarea[disabled],
.frappe-control textarea[readonly] {
  color: var(--pv-field-ink) !important;
  -webkit-text-fill-color: var(--pv-field-ink) !important;
  opacity: 1 !important;
  cursor: default;
}

/* placeholders / empty-field hints: muted but legible */
.form-control::placeholder,
.frappe-control input::placeholder,
.frappe-control textarea::placeholder,
.search-bar input::placeholder,
.placeholder-text {
  color: var(--pv-field-ink-muted) !important;
  -webkit-text-fill-color: var(--pv-field-ink-muted) !important;
  opacity: 1 !important;
}

/* native <select> options — without this, dark mode renders OS-default
   white-on-white / black-on-black option lists */
.frappe-control select option,
select.form-control option {
  background-color: var(--pv-field-bg-focus);
  color: var(--pv-field-ink);
}

/* link search results, dropdown items, and link-field value links */
.awesomplete > ul li,
.dropdown-menu .dropdown-item,
.control-value a,
.frappe-control .link-btn {
  color: var(--pv-field-ink) !important;
}
