/* Auto-generated by CSS refactor */

/* END PATCH: THEME2 BACKDROP */

/* =========================
   THEME 3 — COFFEE NOIR
   ========================= */
/* =========================
   THEME 4 — OBSIDIAN GOLD (MASTER MATERIAL)
   ========================= */
body[data-theme="4"]{

  /* БАЗА — плотный обсидиан */
  --bg:#050607;
  --bg-deep:#030405;

  /* ПОВЕРХНОСТЬ — графит */
  --card:#0F1115;

  --text:#F4F6F8;
  --muted:rgba(244,246,248,0.58);

  /* Золото — благородное */
  --accent:#E7B95A;
  --accent-soft:rgba(231,185,90,0.18);

  --stroke:rgba(231,185,90,0.14);

  --shadow-lg:0 28px 70px rgba(0,0,0,0.88);
  --shadow-md:0 14px 38px rgba(0,0,0,0.75);

  --nav-bg:#050607;

  position:relative;
}

/* ГЛУБИНА СЦЕНЫ */
body[data-theme="4"]::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;

  background:
    radial-gradient(900px 600px at 20% 8%, rgba(231,185,90,0.08), transparent 60%),
    radial-gradient(700px 500px at 80% 18%, rgba(231,185,90,0.05), transparent 65%),
    linear-gradient(180deg, #050607 0%, #020303 100%);
}

body[data-theme="4"] .ci{ background:rgba(15,17,20,0.92) !important; }

/* // НАЧАЛО ПАТЧА: THEME4 — MODAL BODY (MC) DENSITY + LUX BORDER */
body[data-theme="4"] #m-add .mc,
body[data-theme="4"] #m-extra .mc,
body[data-theme="4"] #m-debt .mc{
  background: rgba(7,8,10,0.92) !important;           /* плотный обсидиан */
  border: 1px solid rgba(255,211,106,0.18) !important; /* тонкое золото */
  box-shadow:
    0 26px 70px rgba(0,0,0,0.86),
    inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

body[data-theme="4"] #m-add .modal-content,
body[data-theme="4"] #m-extra .modal-content,
body[data-theme="4"] #m-debt .modal-content{
  background: transparent !important; /* чтоб не было второй “серой пленки” */
}

/* НАЧАЛО ПАТЧА: THEME4 — MODAL HEADER (MC-TOP) + CLOSE LUX */
body[data-theme="4"] #m-add .mc-top,
body[data-theme="4"] #m-extra .mc-top,
body[data-theme="4"] #m-debt .mc-top{
  background: rgba(7,8,10,0.92) !important;
  border-bottom: 1px solid rgba(255,211,106,0.16) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55) !important;
}

body[data-theme="4"] #m-add .mc-top h2,
body[data-theme="4"] #m-extra .mc-top h2,
body[data-theme="4"] #m-debt .mc-top h2{
  color: rgba(243,245,247,0.92) !important;
  text-shadow: 0 10px 26px rgba(0,0,0,0.60) !important;
}

/* Крестик: компактный и “дорогой” */
body[data-theme="4"] #m-add .mc-x,
body[data-theme="4"] #m-extra .mc-x,
body[data-theme="4"] #m-debt .mc-x{
  width: 44px !important;
  height: 44px !important;
  border: 1px solid rgba(255,211,106,0.18) !important;
  background: rgba(12,13,16,0.78) !important;
  box-shadow: 0 16px 34px rgba(0,0,0,0.70) !important;
}

body[data-theme="4"] #m-add .mc-x:hover,
body[data-theme="4"] #m-extra .mc-x:hover,
body[data-theme="4"] #m-debt .mc-x:hover{
  border-color: rgba(255,211,106,0.28) !important;
}

/* НАЧАЛО ПАТЧА: NAV NV SOLID (THEME 4 SAFE) */
body[data-theme="4"] .nv{
  background: #0B0D11 !important;            /* плотный обсидиан */
  opacity: 1 !important;

  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  border-top: 1px solid rgba(255,211,106,0.08) !important;

  box-shadow:
    0 -18px 60px rgba(0,0,0,0.95),
    inset 0 1px 0 rgba(255,255,255,0.03) !important;
}

/* // НАЧАЛО ПАТЧА: THEME4 — MODAL FIELDS LUX (INPUT/SELECT/TEXTAREA) */
body[data-theme="4"] #m-add .modal-content input,
body[data-theme="4"] #m-add .modal-content select,
body[data-theme="4"] #m-add .modal-content textarea,
body[data-theme="4"] #m-extra .modal-content input,
body[data-theme="4"] #m-extra .modal-content select,
body[data-theme="4"] #m-extra .modal-content textarea,
body[data-theme="4"] #m-debt .modal-content input,
body[data-theme="4"] #m-debt .modal-content select,
body[data-theme="4"] #m-debt .modal-content textarea{
  background: rgba(12,13,16,0.88) !important;
  color: rgba(243,245,247,0.92) !important;
  border: 1px solid rgba(255,211,106,0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 34px rgba(0,0,0,0.55) !important;
}

/* Плейсхолдеры — читаемые, но не “кричат” */
body[data-theme="4"] #m-add .modal-content input::placeholder,
body[data-theme="4"] #m-add .modal-content textarea::placeholder,
body[data-theme="4"] #m-extra .modal-content input::placeholder,
body[data-theme="4"] #m-extra .modal-content textarea::placeholder,
body[data-theme="4"] #m-debt .modal-content input::placeholder,
body[data-theme="4"] #m-debt .modal-content textarea::placeholder{
  color: rgba(243,245,247,0.46) !important;
}

/* Фокус — тонкий золотой */
body[data-theme="4"] #m-add .modal-content input:focus,
body[data-theme="4"] #m-add .modal-content select:focus,
body[data-theme="4"] #m-add .modal-content textarea:focus,
body[data-theme="4"] #m-extra .modal-content input:focus,
body[data-theme="4"] #m-extra .modal-content select:focus,
body[data-theme="4"] #m-extra .modal-content textarea:focus,
body[data-theme="4"] #m-debt .modal-content input:focus,
body[data-theme="4"] #m-debt .modal-content select:focus,
body[data-theme="4"] #m-debt .modal-content textarea:focus{
  border-color: rgba(255,211,106,0.34) !important;
  outline: none !important;
  box-shadow:
    0 0 0 2px rgba(255,211,106,0.10),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 16px 40px rgba(0,0,0,0.62) !important;
}

/* =========================================================
   ========================================================= */
/* =========================================================
   Делается ТОЛЬКО в конце .css. Не трогаем исходные темы.
   ========================================================= */

body[data-theme="4"]{
  --bg:#07080A !important;                 /* обсидиан */
  --card:rgba(17,19,23,0.94) !important;   /* дорогой графит */

  --text:#F3F5F7 !important;
  --muted:rgba(243,245,247,0.56) !important;

  --accent:#FFD36A !important;
  --accent2:#C79A3A !important;

  --stroke:rgba(255,211,106,0.16) !important;

  --shadow:18px 18px 44px rgba(0,0,0,0.84) !important;
  --shadow2:-18px -18px 44px rgba(255,255,255,0.02) !important;

  --p-bg:rgba(17,19,23,0.95) !important;
  --p-brd:rgba(255,211,106,0.14) !important;
  --p-in:rgba(255,255,255,0.06) !important;
  --p-sh:0 24px 60px rgba(0,0,0,0.86) !important;

  --ring:rgba(255,211,106,0.14) !important;
  --aura:rgba(255,211,106,0.05) !important;

  --nav-bg:rgba(7,8,10,0.97) !important;
  --nav-sh:0 34px 86px rgba(0,0,0,0.88) !important;
}

/* принудительный фон, чтобы обсидиан точно применялся */
html body[data-theme="4"]{
  background: var(--bg) !important;
  background-attachment: fixed !important;
}

/* фон-подложка — чистая, без “пыли” */
body[data-theme="4"]::before{
  content:"" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index:-1 !important;
  pointer-events:none !important;
  background:
    radial-gradient(1200px 720px at 18% 10%, rgba(255,211,106,0.10), rgba(0,0,0,0) 62%),
    radial-gradient(980px 620px at 82% 16%, rgba(255,211,106,0.08), rgba(0,0,0,0) 64%),
    radial-gradient(900px 650px at 50% 92%, rgba(255,211,106,0.06), rgba(0,0,0,0) 62%),
    linear-gradient(180deg, #07080A 0%, #050506 100%) !important;
}

/* НАЧАЛО ПАТЧА: THEME 4 — FIX GOAL + SEARCH (LUX, NO MUD) */

/* Блок "Цель" — чище и контрастнее */
body[data-theme="4"] .goal,
body[data-theme="4"] .goal-mini{
  background: rgba(10,12,15,0.78) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: rgba(255,255,255,0.86) !important;
}

body[data-theme="4"] .goal .muted,
body[data-theme="4"] .goal-mini .muted{
  color: rgba(255,255,255,0.62) !important;
}

/* ВАЖНО: у тебя визуал "поиска" делает контейнер, а не только input */
body[data-theme="4"] .search-box{
  background: rgba(10,12,15,0.72) !important;
  border-color: rgba(255,255,255,0.10) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.62) !important;
}

/* input делаем прозрачным, чтобы не было двойной мутной подложки */
body[data-theme="4"] .search-box input,
body[data-theme="4"] #search-input{
  background: transparent !important;
  color: rgba(255,255,255,0.86) !important;
}

body[data-theme="4"] #search-input::placeholder{
  color: rgba(255,255,255,0.55) !important;
  opacity: 1 !important;
}

/* фокус — тонкий золотой, без “грязного” серо-золота */
body[data-theme="4"] #search-input:focus{
  outline: none !important;
  border-color: rgba(255,211,106,0.22) !important;
  box-shadow:
    0 0 0 1px rgba(255,211,106,0.18),
    0 0 0 4px rgba(255,211,106,0.10) !important;
}

/* КОНЕЦ ПАТЧА: THEME 4 — FIX GOAL + SEARCH (LUX, NO MUD) */
/* =========================================================
   ========================================================= */
   /* =========================================================
   Только для обсидиана. Не трогаем другие темы.
   ========================================================= */

/* 1) БАЗОВЫЕ ТЕКСТОВЫЕ ТОКЕНЫ (только в теме 4) */
body[data-theme="4"]{
  --t-xs: 12px;
  --t-sm: 13px;
  --t-md: 14px;
  --t-lg: 16px;

  --w-regular: 450;
  --w-medium: 550;
  --w-semibold: 650;
  --w-bold: 750;

  --lh-tight: 1.25;
  --lh-normal: 1.45;

  --ls-tight: -0.01em;
  --ls-normal: 0;
}

/* 2) ОБЩИЙ РИТМ ВНУТРИ МОДАЛОК (главное место, где сейчас “крупно”) */
body[data-theme="4"] .md .mc{
  font-size: var(--t-md);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-normal);
}

/* 3) ЛЕЙБЛЫ/ПОДПИСИ — меньше и спокойнее */
body[data-theme="4"] .md .mc .muted,
body[data-theme="4"] .md .mc .hint,
body[data-theme="4"] .md .mc .lbl{
  font-size: var(--t-sm) !important;
  font-weight: var(--w-regular) !important;
  opacity: 0.85;
  letter-spacing: var(--ls-normal);
}

/* 4) ЗАГОЛОВКИ БЛОКОВ — без “900”, аккуратно */
body[data-theme="4"] .md .mc h1,
body[data-theme="4"] .md .mc h2,
body[data-theme="4"] .md .mc h3,
body[data-theme="4"] .md .mc .ttl,
body[data-theme="4"] .md .mc .title{
  font-size: var(--t-lg) !important;
  font-weight: var(--w-semibold) !important;
  line-height: var(--lh-tight) !important;
  letter-spacing: var(--ls-tight) !important;
}

/* 5) ПОЛЯ В МОДАЛКАХ — текст меньше и не “орёт” */
body[data-theme="4"] .md .mc input,
body[data-theme="4"] .md .mc select,
body[data-theme="4"] .md .mc textarea{
  font-size: var(--t-md) !important;
  font-weight: var(--w-medium) !important;
  letter-spacing: var(--ls-normal) !important;
}

/* 6) КНОПКИ В МОДАЛКАХ — премиум вес */
body[data-theme="4"] .md .mc .br,
body[data-theme="4"] .md .mc button{
  font-weight: var(--w-semibold) !important;
  letter-spacing: var(--ls-tight) !important;
}

/* 7) СУММЫ/ИТОГИ — выделяем, но без “крика” */
body[data-theme="4"] .total,
body[data-theme="4"] .sum,
body[data-theme="4"] .money{
  font-weight: var(--w-bold) !important;
  letter-spacing: var(--ls-tight) !important;
}

/* =========================================================
   ========================================================= */
   /* =========================================================
   Только для обсидиана. Убираем “непонятные” серые.
   ========================================================= */

/* 1) Плейсхолдеры: всегда читаемые на обсидиане (как поиск контрагента) */
body[data-theme="4"] input::placeholder,
body[data-theme="4"] textarea::placeholder{
  color: rgba(255,255,255,0.55) !important;
  opacity: 1 !important;
}

/* 2) Поля ввода/поиска: премиум-поверхность + контраст (как поиск контрагента) */
body[data-theme="4"] input,
body[data-theme="4"] select,
body[data-theme="4"] textarea{
  color: rgba(255,255,255,0.86) !important;
  background: rgba(14,16,19,0.72) !important;
  border: 1px solid rgba(255,211,106,0.22) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 10px 26px rgba(0,0,0,0.45) !important;
}

/* 3) Фокус: аккуратное золото, без “кислоты” */
body[data-theme="4"] input:focus,
body[data-theme="4"] select:focus,
body[data-theme="4"] textarea:focus{
  outline: none !important;
  border-color: rgba(255,211,106,0.26) !important;
  box-shadow:
    0 0 0 3px rgba(255,211,106,0.10),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 12px 30px rgba(0,0,0,0.55) !important;
}

/* 4) “Цель не задана” и похожие подписи: усиливаем контраст точечно */
body[data-theme="4"] .goal,
body[data-theme="4"] .goal-text,
body[data-theme="4"] .goalTitle,
body[data-theme="4"] .goal-title,
body[data-theme="4"] #goal,
body[data-theme="4"] #goalBox,
body[data-theme="4"] #goal-box,
body[data-theme="4"] #goalName,
body[data-theme="4"] #goal-name{
  color: rgba(243,245,247,0.74) !important;
}

/* 5) Очень частый случай: “поиск” в списках (подстрахуем id) */
body[data-theme="4"] #q,
body[data-theme="4"] #search,
body[data-theme="4"] #searchInput,
body[data-theme="4"] #catSearch,
body[data-theme="4"] #debtSearch{
  color: var(--text) !important;
}

/* =========================================================
   ========================================================= */
   /* =========================================================
   Главная строка “Введи категорию…” часто НЕ input — поэтому расширяем охват.
   ========================================================= */

/* 1) Общий стиль для “поля добавления” на главной (страховка по классам) */
body[data-theme="4"] .add,
body[data-theme="4"] .addbox,
body[data-theme="4"] .add-box,
body[data-theme="4"] .addInput,
body[data-theme="4"] .add-input,
body[data-theme="4"] .main-add,
body[data-theme="4"] .mainAdd,
body[data-theme="4"] #add,
body[data-theme="4"] #addBox,
body[data-theme="4"] #add-box,
body[data-theme="4"] #quickAdd,
body[data-theme="4"] #quick-add{
  color: var(--text) !important;
  background: rgba(14,16,19,0.72) !important;
  border: 1px solid rgba(255,211,106,0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 12px 30px rgba(0,0,0,0.50) !important;
}

/* 2) Если это input — уже ок, но добавим точный плейсхолдер */
body[data-theme="4"] .add::placeholder,
body[data-theme="4"] .addbox::placeholder,
body[data-theme="4"] .add-box::placeholder,
body[data-theme="4"] #add::placeholder,
body[data-theme="4"] #quickAdd::placeholder,
body[data-theme="4"] #quick-add::placeholder{
  color: rgba(255,255,255,0.55) !important;
  opacity: 1 !important;
}

/* 3) Если это не input, а div/span — тогда текст “плейсхолдера” обычно внутри */
body[data-theme="4"] .add .ph,
body[data-theme="4"] .add .placeholder,
body[data-theme="4"] .addbox .ph,
body[data-theme="4"] .addbox .placeholder,
body[data-theme="4"] .add-box .ph,
body[data-theme="4"] .add-box .placeholder,
body[data-theme="4"] #add .ph,
body[data-theme="4"] #add .placeholder,
body[data-theme="4"] #quickAdd .ph,
body[data-theme="4"] #quickAdd .placeholder{
  color: rgba(243,245,247,0.58) !important;
}

/* 4) Фокус/актив на главной строке */
body[data-theme="4"] .add:focus,
body[data-theme="4"] .addbox:focus,
body[data-theme="4"] .add-box:focus,
body[data-theme="4"] #add:focus,
body[data-theme="4"] #quickAdd:focus,
body[data-theme="4"] #quick-add:focus{
  outline: none !important;
  border-color: rgba(255,211,106,0.26) !important;
  box-shadow:
    0 0 0 3px rgba(255,211,106,0.10),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 34px rgba(0,0,0,0.55) !important;
}

/* =========================================================
   ========================================================= */
   /* =========================================================
   THEME 4 — LUX MAIN INPUT REFINEMENT
   ========================================================= */

body[data-theme="4"] .add,
body[data-theme="4"] .addbox,
body[data-theme="4"] .add-box,
body[data-theme="4"] #quickAdd,
body[data-theme="4"] #add{
  
  background: #0c0f13 !important; /* чистый обсидиан */
  
  border: 1px solid rgba(255,255,255,0.06) !important; /* тонкий дорогой бордер */
  
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 22px rgba(0,0,0,0.55) !important; /* без желтой ауры */

  padding: 18px 22px !important; /* больше воздуха */
  
  border-radius: 20px !important;
}

/* плейсхолдер */
body[data-theme="4"] .add::placeholder,
body[data-theme="4"] #quickAdd::placeholder{
  color: rgba(240,240,240,0.65) !important;
  font-weight: 500;
}

/* фокус — тонкий ювелирный */
body[data-theme="4"] .add:focus,
body[data-theme="4"] #quickAdd:focus{
  border-color: rgba(255,211,106,0.22) !important;
  box-shadow:
    0 0 0 2px rgba(255,211,106,0.08),
    0 10px 26px rgba(0,0,0,0.6) !important;
}

/* =========================================================
   ========================================================= */

body[data-theme="4"] #search-input{
  color: var(--text) !important;

  /* чистый обсидиан без мутной серости */
  background: rgba(10,12,14,0.92) !important;

  /* тонкий “дорогой” контур */
  border: 1px solid rgba(255,255,255,0.07) !important;

  border-radius: 20px !important;
  padding: 18px 22px !important;

  /* никакой золотой ауры — только аккуратная глубина */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 10px 26px rgba(0,0,0,0.62) !important;
}

/* плейсхолдер — читаемый, но не белый */
body[data-theme="4"] #search-input::placeholder{
  color: rgba(244,245,247,0.62) !important;
  opacity: 1 !important;
  font-weight: 550 !important;
}

/* фокус — “ювелирный” тонкий золотой, без мутности */
body[data-theme="4"] #search-input:focus{
  outline: none !important;

  border-color: rgba(255,211,106,0.18) !important;

  box-shadow:
    0 0 0 2px rgba(255,211,106,0.06),
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 12px 30px rgba(0,0,0,0.68) !important;
}

/* =========================================================
   ========================================================= */
   /* =========================
   THEME 4 — CARD DEPTH LAYER
   ========================= */

body[data-theme="4"] .card,
body[data-theme="4"] .box,
body[data-theme="4"] .tile,
body[data-theme="4"] .entry,
body[data-theme="4"] .goal-box,
body[data-theme="4"] .nav-item{

  background: linear-gradient(
    180deg,
    rgba(22,24,29,0.96) 0%,
    rgba(14,16,20,0.96) 100%
  );

  border: 1px solid rgba(231,185,90,0.12);

  box-shadow:
    0 18px 42px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.6);

  backdrop-filter: none;
}

/* тонкий верхний блик */
body[data-theme="4"] .card::before,
body[data-theme="4"] .box::before,
body[data-theme="4"] .tile::before,
body[data-theme="4"] .entry::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:1px;
  background:linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.15),
    transparent
  );
  opacity:0.5;
}

/* =========================
   THEME 4 — BUTTON FIX (GOAL / THEME)
   ========================= */

body[data-theme="4"] .goal-btn,
body[data-theme="4"] .theme-btn{

  background: linear-gradient(
    180deg,
    rgba(20,22,27,0.95) 0%,
    rgba(12,14,18,0.95) 100%
  );

  border: 1px solid rgba(255,211,106,0.22);

  box-shadow:
    0 10px 26px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255,255,255,0.06);

  color: var(--text);
}

/* =========================
   THEME 4 — CARD DEPTH FIX
   ========================= */

body[data-theme="4"] .card,
body[data-theme="4"] .block,
body[data-theme="4"] .stat-card{

  background: linear-gradient(
    180deg,
    rgba(18,20,24,0.96) 0%,
    rgba(10,12,16,0.96) 100%
  );

  border: 1px solid rgba(255,211,106,0.12);

  box-shadow:
    0 22px 60px rgba(0,0,0,0.88),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* =========================
   ========================= */

/* 1) В теме 4 убираем “молочную серость” у плиток иконок */
body[data-theme="4"] .nv .nb b{
  background: rgba(12,14,18,0.62) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: rgba(255,255,255,0.90) !important;

  box-shadow:
    0 10px 24px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.55) !important;
}

/* 2) Активная вкладка: ювелирный акцент (без дешёвого glow) */
body[data-theme="4"] .nv .nb.a{
  color: rgba(255,255,255,0.92) !important;
}

body[data-theme="4"] .nv .nb.a b{
  position: relative !important;

  background: linear-gradient(
    180deg,
    rgba(18,20,24,0.94) 0%,
    rgba(10,12,16,0.94) 100%
  ) !important;

  border-color: rgba(255,211,106,0.42) !important;

  /* делаем “золото” заметным не контуром, а тоном */
  color: rgba(255,211,106,0.92) !important;

  box-shadow:
    0 16px 36px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(255,211,106,0.16) !important;
}

/* тонкий индикатор активной вкладки (самое читаемое решение) */
/* body[data-theme="4"] .nv .nb.a::after{
  content:"" !important;
  position:absolute !important;
  left: 18% !important;
  right: 18% !important;
  bottom: 6px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: rgba(255,211,106,0.78) !important;
  box-shadow: 0 6px 18px rgba(255,211,106,0.14) !important;
  pointer-events:none !important;
}
/* =========================
   ========================= */

/* оверлей */
body[data-theme="4"] .md{
  background: rgba(0,0,0,0.82) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* НАЧАЛО ПАТЧА: THEME4 MODAL BUTTONS LUX (NO LAG) */
body[data-theme="4"] #m-add .mc button,
body[data-theme="4"] #m-add .mc .btn,
body[data-theme="4"] #m-extra .mc button,
body[data-theme="4"] #m-extra .mc .btn{
  background: linear-gradient(180deg, rgba(24,26,30,0.96) 0%, rgba(14,16,20,0.96) 100%) !important;
  border: 1px solid rgba(255,211,106,0.22) !important;
  box-shadow:
    0 18px 44px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.55) !important;
  color: rgba(243,245,247,0.92) !important;
}

body[data-theme="4"] #m-add .mc button:active,
body[data-theme="4"] #m-add .mc .btn:active,
body[data-theme="4"] #m-extra .mc button:active,
body[data-theme="4"] #m-extra .mc .btn:active{
  transform: translateY(1px);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.70),
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.62) !important;
  border-color: rgba(255,211,106,0.30) !important;
}

body[data-theme="4"] #m-add .mc button:focus,
body[data-theme="4"] #m-add .mc .btn:focus,
body[data-theme="4"] #m-extra .mc button:focus,
body[data-theme="4"] #m-extra .mc .btn:focus{
  outline: none !important;
  box-shadow:
    0 18px 44px rgba(0,0,0,0.72),
    0 0 0 2px rgba(255,211,106,0.14),
    inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

/* НАЧАЛО ПАТЧА: THEME4 DATE FIELDS = ONE CONTAINER (OBSIDIAN) */

/* 1) ОБСИДИАН ДЕЛАЕМ НА ВНЕШНЕМ КОНТЕЙНЕРЕ (а не на input) */
body[data-theme="4"] #m-add .in-date,
body[data-theme="4"] #m-add #ship-date-wrap{
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  border-radius: var(--form-radius) !important;
}

/* 2) ВНУТРЕННИЙ date/datetime делаем “невидимой оболочкой” (убираем его фон/рамки) */
body[data-theme="4"] #m-add .in-date input[type="date"],
body[data-theme="4"] #m-add .in-date input[type="datetime-local"],
body[data-theme="4"] #m-add input#i-due,
body[data-theme="4"] #m-add input#i-date{
  -webkit-appearance: none !important;
  appearance: none !important;

  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;

  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;

  outline: none !important;
}

/* 3) Иконка календаря в тему (без второго серого прямоугольника) */
body[data-theme="4"] #m-add .in-date input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="4"] #m-add .in-date input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body[data-theme="4"] #m-add input#i-due::-webkit-calendar-picker-indicator,
body[data-theme="4"] #m-add input#i-date::-webkit-calendar-picker-indicator{
  opacity: 0.85 !important;
  filter: invert(1) brightness(1.05) !important;
}

/* КОНЕЦ ПАТЧА: THEME4 DATE FIELDS = ONE CONTAINER (OBSIDIAN) */
/* НАЧАЛО ПАТЧА: THEME4 INPUTS PREMIUM */

body[data-theme="4"] #m-add .mc input,
body[data-theme="4"] #m-add .mc select,
body[data-theme="4"] #m-add .mc textarea{
  background: linear-gradient(180deg, rgba(22,24,28,0.96) 0%, rgba(14,16,20,0.96) 100%) !important;
  border: 1px solid rgba(255,211,106,0.20) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.60),
    0 12px 28px rgba(0,0,0,0.60) !important;
  color: rgba(243,245,247,0.95) !important;
}

body[data-theme="4"] #m-add .mc input:focus,
body[data-theme="4"] #m-add .mc select:focus,
body[data-theme="4"] #m-add .mc textarea:focus{
  border-color: rgba(255,211,106,0.34) !important;
  box-shadow:
    0 0 0 2px rgba(255,211,106,0.12),
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 16px 36px rgba(0,0,0,0.65) !important;
  outline: none !important;
}

/* НАЧАЛО ПАТЧА: THEME4 DATE WRAP REMOVE DOUBLE LAYER */
body[data-theme="4"] #m-add .in-date{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* КОНЕЦ ПАТЧА: THEME4 DATE WRAP REMOVE DOUBLE LAYER */
/* =========================
   ========================= */
   /* =========================
   ========================= */

body[data-theme="4"] .mc h2,
body[data-theme="4"] .modal-title,
body[data-theme="4"] .mc-header{

  background: linear-gradient(
    180deg,
    rgba(14,16,20,1) 0%,
    rgba(10,12,16,1) 100%
  ) !important;

  border-bottom: 1px solid rgba(255,211,106,0.18) !important;

  color: rgba(255,255,255,0.92) !important;

  box-shadow: none !important;
}

/* убираем светлый фон если он был */
body[data-theme="4"] .mc h2{
  background-color: transparent !important;
}

/* =========================
   ========================= */
   /* =========================
   ========================= */

body[data-theme="4"] .mc > div:first-child{
  background: linear-gradient(
    180deg,
    rgba(14,16,20,1) 0%,
    rgba(10,12,16,1) 100%
  ) !important;

  border-bottom: 1px solid rgba(255,211,106,0.22) !important;

  box-shadow: none !important;
}

/* убираем светлый фон если где-то остался */
body[data-theme="4"] .mc > div:first-child *{
  background: transparent !important;
}

/* =========================
   ========================= */
   /* =========================
   ========================= */

body[data-theme="4"] .mc{
  background: linear-gradient(180deg,
    rgba(12,13,16,0.99) 0%,
    rgba(6,7,9,0.99) 100%
  ) !important;
}

border: 1px solid rgba(255,211,106,0.22) !important;

  box-shadow:
    0 30px 80px rgba(0,0,0,0.85),
    inset 0 0 0 1px rgba(255,255,255,0.04) !important;

  backdrop-filter: none !important;
}

/* =========================
   ========================= */
   /* // НАЧАЛО ПАТЧА: THEME4 — MODAL BUTTONS LUX */

body[data-theme="4"] #m-add .modal-content button,
body[data-theme="4"] #m-extra .modal-content button,
body[data-theme="4"] #m-debt .modal-content button{

  background: linear-gradient(
    180deg,
    rgba(22,24,29,0.95),
    rgba(14,15,18,0.98)
  ) !important;

  color: rgba(243,245,247,0.92) !important;

  border: 1px solid rgba(255,211,106,0.16) !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 18px 42px rgba(0,0,0,0.65) !important;

  transition: all 160ms ease !important;
}

/* hover / active */
body[data-theme="4"] #m-add .modal-content button:active,
body[data-theme="4"] #m-extra .modal-content button:active,
body[data-theme="4"] #m-debt .modal-content button:active{

  transform: translateY(1px) scale(0.99);

  border-color: rgba(255,211,106,0.36) !important;

  box-shadow:
    0 0 0 2px rgba(255,211,106,0.10),
    0 22px 50px rgba(0,0,0,0.72) !important;
}

/* // КОНЕЦ ПАТЧА: THEME4 — MODAL BUTTONS LUX */
/* // НАЧАЛО ПАТЧА: THEME4 — MODAL CONTAINER LUX */

body[data-theme="4"] .modal-content{

  background: linear-gradient(
    180deg,
    rgba(18,20,24,0.98),
    rgba(10,11,14,1)
  ) !important;

  border: 1px solid rgba(255,211,106,0.22) !important;

  box-shadow:
    0 40px 90px rgba(0,0,0,0.88),
    0 0 0 1px rgba(255,211,106,0.06) inset;

  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  border-radius: 22px !important;
}

/* лёгкий золотой кант по краю */
body[data-theme="4"] .modal-content::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:22px;
  pointer-events:none;

  box-shadow:
    0 0 0 1px rgba(255,211,106,0.08),
    0 0 40px rgba(255,211,106,0.04);
}

/* // КОНЕЦ ПАТЧА: THEME4 — MODAL CONTAINER LUX */
/* НАЧАЛО ПАТЧА: THEME4 SHIP EXPENSES PREMIUM CONTAINER (OBSIDIAN) */

/* 1) Общий контейнер блока расходов */
body[data-theme="4"] #m-add .ship-expenses,
body[data-theme="4"] #m-add .ship-exp,
body[data-theme="4"] #m-add .ship-exp-wrap{
  background: linear-gradient(180deg, rgba(18,20,24,0.92) 0%, rgba(12,14,18,0.92) 100%) !important;
  border: 1px solid rgba(255,211,106,0.16) !important;
  border-radius: 18px !important;
  padding: 14px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 34px rgba(0,0,0,0.60) !important;
}

/* 2) Строка расхода — одна линия, без “второй карточки” */
body[data-theme="4"] #m-add .ship-expenses .exp-row,
body[data-theme="4"] #m-add .ship-exp .exp-row,
body[data-theme="4"] #m-add .ship-exp-wrap .exp-row{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;

  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 16px !important;
  padding: 12px 12px !important;

  color: rgba(243,245,247,0.92) !important;
  font-weight: 600 !important;
}

/* Текст расхода */
body[data-theme="4"] #m-add .ship-expenses .exp-row .exp-title,
body[data-theme="4"] #m-add .ship-exp .exp-row .exp-title,
body[data-theme="4"] #m-add .ship-exp-wrap .exp-row .exp-title{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 16px !important;
  letter-spacing: 0.2px !important;
  opacity: 0.92 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ============================================
   OBSIDIAN — КРЕСТИК В РАСХОДАХ ПО ОТГРУЗКЕ
   (без конфликта с fish-logic)
============================================ */

body[data-theme="4"] #m-add .ship-exp-row button:not(.ship-exp-who-btn){
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
  border-radius: 8px !important;

  background: rgba(255,80,80,0.12) !important;
  border: 1px solid rgba(255,80,80,0.22) !important;
  color: rgba(255,100,100,0.8) !important;

  font-size: 12px !important;
  font-weight: 900 !important;

  box-shadow: none !important;
}

body[data-theme="4"] .ship-exp-who-btn {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 11px 8px !important;
  border-radius: 12px !important;
  border: 1.5px solid rgba(196,154,40,0.4) !important;
  background: transparent !important;
  color: rgba(232,217,160,0.7) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  opacity: 0.6 !important;
  white-space: nowrap !important;
}

body[data-theme="4"] .ship-exp-who-btn.buyer.active {
  background: #27ae60 !important;
  border-color: #27ae60 !important;
  color: #fff !important;
  opacity: 1 !important;
}

body[data-theme="4"] .ship-exp-who-btn.mine.active {
  background: #e74c3c !important;
  border-color: #e74c3c !important;
  color: #fff !important;
  opacity: 1 !important;
}

/* НАВЕДЕНИЕ */
body[data-theme="4"] #m-add .ship-expenses .exp-row button:active,
body[data-theme="4"] #m-add .ship-exp .exp-row button:active,
body[data-theme="4"] #m-add .ship-exp-wrap .exp-row button:active{
  transform: scale(0.98) !important;
}

/* КОНЕЦ ПАТЧА: THEME4 SHIP EXPENSES PREMIUM CONTAINER (OBSIDIAN) */
/* ============================================
   OBSIDIAN — РОВНАЯ СТРОКА РАСХОДА (ТЕКСТ + КРЕСТИК)
============================================ */
body[data-theme="4"] #m-add .ship-exp-row{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

body[data-theme="4"] #m-add .ship-exp-row .exp-title{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: block !important;
}

/* ============================================
   THEME 4 (OBSIDIAN): SHIP EXPENSES — ONE BLOCK, ROWS (NO INNER CARDS)
   ============================================ */
body[data-theme="4"] #m-add .ship-exp-line,
body[data-theme="4"] #m-add .ship-expenses{
  background: linear-gradient(180deg, rgba(20,22,26,.96) 0%, rgba(12,14,18,.96) 100%) !important;
  border: 1px solid rgba(255,211,106,.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 16px 36px rgba(0,0,0,.65) !important;
  border-radius: 22px !important;
  padding: 12px 12px !important;
}

/* УБИРАЕМ "КАРТОЧКУ ВНУТРИ": каждая строка расхода становится плоской и компактной */
body[data-theme="4"] #m-add .ship-exp-row{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  padding: 8px 4px !important;   /* компактнее */
  margin: 0 !important;

  display: flex !important;
  align-items: center !important;
  gap: 8px !important;            /* компактнее */
}

/* Разделитель между строками (аккуратно, как в Obsidian) */
body[data-theme="4"] #m-add .ship-exp-row + .ship-exp-row{
  border-top: 1px solid rgba(255,255,255,.06) !important;
}

/* Текст и сумма: одинаковый стиль и ровные колонки */
body[data-theme="4"] #m-add .ship-exp-row .exp-title{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 16px !important;
  font-weight: 650 !important;
  color: rgba(243,245,247,.92) !important;
  letter-spacing: .2px !important;
}

body[data-theme="4"] #m-add .ship-exp-row .exp-amt{
  flex: 0 0 auto !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  color: rgba(255,211,106,.92) !important;
  margin-left: auto !important;
}

/* КРЕСТИК — OBSIDIAN (НЕ КРАСНЫЙ "КИРПИЧ") */
body[data-theme="4"] #m-add .ship-exp-row .exp-del,
body[data-theme="4"] #m-add .ship-exp-row button:not(.ship-exp-who-btn){
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;

  border-radius: 10px !important;
  font-size: 16px !important;
  line-height: 28px !important;
  padding: 0 !important;

  background: rgba(0,0,0,.20) !important;                 /* Obsidian */
  border: 1px solid rgba(255,211,106,.18) !important;     /* тихий акцент */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
  color: rgba(243,245,247,.82) !important;
}

/* Красный — только при нажатии (опасное действие) */
body[data-theme="4"] #m-add .ship-exp-row .exp-del:active,
body[data-theme="4"] #m-add .ship-exp-row button:not(.ship-exp-who-btn):active{
  background: rgba(255,84,84,.14) !important;
  border-color: rgba(255,84,84,.30) !important;
  color: rgba(255,220,220,.92) !important;
}

/* ============================================
   КОНЕЦ ПАТЧА: FPE — ДАТЫ ВНУТРИ ПОЛЯ (РУЧКИ)
   ============================================ */
   /* ============================================
   НАЧАЛО ПАТЧА: ДАТЫ — ЯСНО ГДЕ ЦИФРЫ И ГДЕ СТРЕЛКА
   ============================================ */

/* ====== НАСТРОЙКИ (КРУТИЛКИ) ======
   1) ЦИФРЫ ВВЕРХ/ВНИЗ: меняй --DATE_NUM_BOTTOM
      МЕНЬШЕ = НИЖЕ (6px -> 4px -> 2px)
      БОЛЬШЕ = ВЫШЕ (6px -> 8px -> 10px)

   2) ВЫСОТА ЛИНИИ ЦИФР: меняй --DATE_NUM_H
      МЕНЬШЕ = КОМПАКТНЕЕ (34px -> 32px)
      БОЛЬШЕ = СВОБОДНЕЕ (34px -> 36px)

   3) РАЗМЕР ЦИФР: меняй --DATE_NUM_SIZE
      (16px -> 15px)

   4) СЛЕВА/СПРАВА ЦИФРЫ: --DATE_NUM_PAD_L / --DATE_NUM_PAD_R
*/
body[data-theme="4"]{
  --DATE_NUM_BOTTOM: -6px;     /* ← ЦИФРЫ ВВЕРХ/ВНИЗ */
  --DATE_NUM_H: 34px;         /* ← ВЫСОТА ЛИНИИ ЦИФР */
  --DATE_NUM_SIZE: 12px;      /* ← РАЗМЕР ЦИФР */
  --DATE_NUM_PAD_L: 18px;     /* ← ЦИФРЫ СЛЕВА/СПРАВА */
  --DATE_NUM_PAD_R: 56px;     /* ← МЕСТО СПРАВА ПОД СТРЕЛКУ/ИКОНКУ */
  --DATE_LABEL_TOP: 10px;     /* ← СЛОВА "Дата..." ВВЕРХ/ВНИЗ */
}

/* КОНЕЦ ПАТЧА: ЕДИНЫЙ ШРИФТ ВО ВСЕХ МОДАЛКАХ (OBSIDIAN LUX) */
/* ===== THEME 4 LUX OBSIDIAN BACK ===== */
body[data-theme="4"]{
  --bg: #07090c;
  --card: #0f1319;
  --text: rgba(243,245,247,.92);
}

body[data-theme="4"]{
  background:
    radial-gradient(
      1200px 600px at 50% -200px,
      rgba(255,211,106,0.08),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 50% 30%,
      rgba(16,20,28,0.6),
      transparent 70%
    ),
    #07090c;
}

/* =========================================================
   НАЧАЛО ПАТЧА: THEME 4 — OBSIDIAN ULTRA LUX EDGES (MAIN SAFE)
   ========================================================= */
body[data-theme="4"]{
  /* Ювелирные кромки (ультра тонко, без “колхоза”) */
  --lux-edge-cold: rgba(255,255,255,0.08);   /* холодная линия сверху */
  --lux-edge-deep: rgba(0,0,0,0.62);         /* внутренняя тень-кромка */
  --lux-edge-gold: rgba(255,211,106,0.20);   /* золотая “нить” */
  --lux-glass: radial-gradient(120% 90% at 30% 10%, rgba(255,255,255,0.06), rgba(255,255,255,0) 55%);
}

/* Главные карточки/панели на главной и в разделах */
body[data-theme="4"] .cd,
body[data-theme="4"] .mb,
body[data-theme="4"] .sb,
body[data-theme="4"] .it,
body[data-theme="4"] .goal-mini,
body[data-theme="4"] .search-box,
body[data-theme="4"] .ii{
  background:
    var(--lux-glass),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)) !important;

  border: 1px solid rgba(255,211,106,0.18) !important; /* тонкий золотой кант */
  box-shadow:
    0 16px 40px rgba(0,0,0,0.72),                 /* глубина */
    0 1px 0 var(--lux-edge-cold) inset,           /* холодная линия */
    0 -1px 0 var(--lux-edge-deep) inset,          /* внутренняя тень */
    0 0 0 1px rgba(0,0,0,0.55) inset !important;  /* плотность */
}

/* Поля и кнопки — тот же язык (без изменения размеров/отступов) */
body[data-theme="4"] input,
body[data-theme="4"] select,
body[data-theme="4"] textarea,
body[data-theme="4"] .br{
  background:
    var(--lux-glass),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)) !important;

  border-color: rgba(255,211,106,0.18) !important;
  box-shadow:
    0 14px 34px rgba(0,0,0,0.70),
    0 1px 0 var(--lux-edge-cold) inset,
    0 -1px 0 var(--lux-edge-deep) inset,
    0 0 0 1px rgba(0,0,0,0.55) inset !important;
}

/* Очень тонкое “дорогое” усиление на активном/фокусе */
body[data-theme="4"] input:focus,
body[data-theme="4"] select:focus,
body[data-theme="4"] textarea:focus{
  border-color: rgba(255,211,106,0.28) !important;
  box-shadow:
    0 16px 40px rgba(0,0,0,0.74),
    0 1px 0 rgba(255,255,255,0.09) inset,
    0 -1px 0 rgba(0,0,0,0.65) inset,
    0 0 0 1px rgba(255,211,106,0.10),
    0 0 0 1px rgba(0,0,0,0.55) inset !important;
}

/* hover (если браузер поддерживает) — без прыжков, только “дорогой блик” */
body[data-theme="4"] .cd:hover,
body[data-theme="4"] .mb:hover,
body[data-theme="4"] .br:hover{
  border-color: rgba(255,211,106,0.26) !important;
}

/* =========================================================
   КОНЕЦ ПАТЧА: THEME 4 — OBSIDIAN ULTRA LUX EDGES (MAIN SAFE)
   ========================================================= */
   /* =======================================================
   OBSIDIAN ULTRA DEPTH — ГЛАВНАЯ СТРАНИЦА
   ======================================================= */

body[data-theme="4"] .cd,
body[data-theme="4"] .mb,
body[data-theme="4"] .ii,
body[data-theme="4"] .search-box {

  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(180deg, #0c0f14 0%, #06080c 100%) !important;

  border: 1px solid rgba(255,211,106,0.22) !important;

  box-shadow:
    0 20px 45px rgba(0,0,0,0.75),        /* глубина */
    inset 0 1px 0 rgba(255,255,255,0.07), /* холодный верх */
    inset 0 -2px 4px rgba(0,0,0,0.8),     /* плотный низ */
    0 0 0 1px rgba(0,0,0,0.6) inset !important;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Лёгкое золото при hover */
body[data-theme="4"] .cd:hover,
body[data-theme="4"] .mb:hover {
  border-color: rgba(255,211,106,0.35) !important;
}

/* =========================================================
   🏆 ULTRA PREMIUM OBSIDIAN — ЮВЕЛИРНЫЕ ДЕТАЛИ
   ========================================================= */

/* 1) ЗВЁЗДЫ (ультра редкие пиксели света в градиентах) */
body[data-theme="4"] .cd::before,
body[data-theme="4"] .mb::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 15% 10%, rgba(255,255,255,0.8), transparent 1px),
    radial-gradient(1px 1px at 85% 90%, rgba(255,211,106,0.6), transparent 1px),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.4), transparent 1px);
  pointer-events: none;
  opacity: 0.3;
  z-index: 1;
  border-radius: inherit;
}

/* 2) МЕГА-ГЛУБИНА: слой-слой-слой */
body[data-theme="4"] .cd,
body[data-theme="4"] .mb{
  position: relative;
  overflow: hidden;
  box-shadow:
    /* слой 1: абсолютная тень (космос) */
    0 32px 64px rgba(0,0,0,0.92),
    /* слой 2: золото-аура */
    0 0 24px rgba(255,211,106,0.12),
    /* слой 3: холодная граница */
    inset 0 2px 6px rgba(255,255,255,0.08),
    /* слой 4: плотный низ */
    inset 0 -4px 12px rgba(0,0,0,0.88),
    /* слой 5: ювелирный кант */
    0 0 0 1px rgba(255,211,106,0.24) !important;
}

/* 3) ПРЕМИУМ ПЕРЕХОДЫ (плавные, как жидкое золото) */
body[data-theme="4"] .cd,
body[data-theme="4"] .mb,
body[data-theme="4"] .br,
body[data-theme="4"] input,
body[data-theme="4"] select,
body[data-theme="4"] textarea{
  transition:
    border-color 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 0.35s ease-out !important;
}

/* 4) КНОПКИ — УЛЬТРА-КЛАСС (они же .br) */
body[data-theme="4"] .br{
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255,211,106,0.08), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)) !important;
  
  border: 1.5px solid rgba(255,211,106,0.25) !important;
  
  box-shadow:
    0 18px 44px rgba(0,0,0,0.80),
    0 2px 4px rgba(255,211,106,0.10) inset,
    inset 0 1px 2px rgba(255,255,255,0.06),
    inset 0 -2px 6px rgba(0,0,0,0.75) !important;
  
  position: relative;
  color: rgba(243,245,247,0.94) !important;
  font-weight: 600 !important;
}

/* 5) КНОПКА НА HOVER — ПРОБУЖДЕНИЕ ЗОЛОТА */
body[data-theme="4"] .br:hover{
  border-color: rgba(255,211,106,0.45) !important;
  box-shadow:
    0 20px 50px rgba(255,211,106,0.15),
    0 20px 50px rgba(0,0,0,0.80),
    0 3px 6px rgba(255,211,106,0.18) inset,
    inset 0 1px 2px rgba(255,255,255,0.08),
    inset 0 -2px 8px rgba(0,0,0,0.78) !important;
  transform: translateY(-1px);
}

/* 6) КНОПКА ACTIVE (нажата) — ВТЯНУТОСТЬ */
body[data-theme="4"] .br:active{
  box-shadow:
    inset 0 8px 20px rgba(0,0,0,0.85),
    inset 0 2px 4px rgba(255,211,106,0.12),
    0 2px 8px rgba(0,0,0,0.95) !important;
  transform: translateY(1px);
}

/* 7) INPUT / SELECT / TEXTAREA — ПРЕМИУМ ПОЛЯ */
body[data-theme="4"] input,
body[data-theme="4"] select,
body[data-theme="4"] textarea{
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255,211,106,0.06), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.02)) !important;
  
  border: 1px solid rgba(255,211,106,0.20) !important;
  
  box-shadow:
    inset 0 4px 12px rgba(0,0,0,0.70),
    inset 0 1px 3px rgba(255,255,255,0.05),
    0 8px 24px rgba(0,0,0,0.65) !important;
  
  color: rgba(243,245,247,0.88) !important;
}

/* 8) INPUT FOCUS — ЗОЛОТАЯ ГЛУБИНА */
body[data-theme="4"] input:focus,
body[data-theme="4"] select:focus,
body[data-theme="4"] textarea:focus{
  border-color: rgba(255,211,106,0.38) !important;
  outline: none !important;
  
  box-shadow:
    inset 0 4px 16px rgba(0,0,0,0.72),
    inset 0 1px 3px rgba(255,255,255,0.07),
    0 0 0 3px rgba(255,211,106,0.18),
    0 12px 28px rgba(255,211,106,0.08),
    0 12px 28px rgba(0,0,0,0.70) !important;
  
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255,211,106,0.10), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.01)) !important;
}

/* 9) ТЕКСТОВЫЕ ЭЛЕМЕНТЫ — ГЛУБОКАЯ ТИПОГРАФИЯ */
body[data-theme="4"] .cd p,
body[data-theme="4"] .mb p,
body[data-theme="4"] .cd h3,
body[data-theme="4"] .mb h3{
  color: rgba(243,245,247,0.92) !important;
  text-shadow: 
    0 2px 4px rgba(0,0,0,0.60),
    0 0 12px rgba(255,211,106,0.06) !important;
}

/* 10) МУТИРОВАННЫЙ ТЕКСТ (secondary) — РАССЕЯННОЕ ЗОЛОТО */
body[data-theme="4"] .muted,
body[data-theme="4"] .mc{
  color: rgba(150,160,172,0.70) !important;
}

/* 11) ОСОБЫЕ БЛОКИ (goal-mini, sb, it) */
body[data-theme="4"] .goal-mini,
body[data-theme="4"] .sb,
body[data-theme="4"] .it,
body[data-theme="4"] .search-box{
  position: relative;
  background:
    radial-gradient(130% 100% at 20% -10%, rgba(255,211,106,0.07), transparent 55%),
    linear-gradient(180deg, rgba(20,25,35,0.80), rgba(5,8,12,0.95)) !important;
  
  border: 1px solid rgba(255,211,106,0.20) !important;
  
  box-shadow:
    0 24px 52px rgba(0,0,0,0.78),
    inset 0 2px 8px rgba(255,255,255,0.06),
    inset 0 -4px 12px rgba(0,0,0,0.80),
    0 0 0 1px rgba(0,0,0,0.50) inset !important;
}

/* 12) HOVER ЭФФЕКТ НА БЛОКАХ */
body[data-theme="4"] .goal-mini:hover,
body[data-theme="4"] .sb:hover,
body[data-theme="4"] .it:hover,
body[data-theme="4"] .search-box:hover{
  border-color: rgba(255,211,106,0.32) !important;
  box-shadow:
    0 28px 60px rgba(255,211,106,0.12),
    0 28px 60px rgba(0,0,0,0.80),
    inset 0 2px 8px rgba(255,255,255,0.07),
    inset 0 -4px 12px rgba(0,0,0,0.82),
    0 0 0 1px rgba(0,0,0,0.50) inset !important;
}

/* 13) АККОРДИОНЫ / ВЫПАДАЮЩИЕ СПИСКИ */
body[data-theme="4"] details,
body[data-theme="4"] summary{
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.02)) !important;
  border-color: rgba(255,211,106,0.18) !important;
}

body[data-theme="4"] summary{
  color: rgba(243,245,247,0.88) !important;
  cursor: pointer;
  transition: color 0.25s ease-out;
}

body[data-theme="4"] summary:hover{
  color: rgba(255,211,106,0.90) !important;
}

/* 14) СКРОЛЛ-БАР (если видим) */
body[data-theme="4"] ::-webkit-scrollbar{
  width: 8px;
  height: 8px;
}

body[data-theme="4"] ::-webkit-scrollbar-track{
  background: rgba(0,0,0,0.40);
  border-radius: 4px;
}

body[data-theme="4"] ::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(255,211,106,0.35), rgba(255,211,106,0.20));
  border-radius: 4px;
  border: 2px solid rgba(0,0,0,0.50);
}

body[data-theme="4"] ::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(255,211,106,0.50), rgba(255,211,106,0.30));
}

/* 15) ПЛЕЙСХОЛДЕРЫ — МЯГКОЕ ЗОЛОТО */
body[data-theme="4"] input::placeholder,
body[data-theme="4"] textarea::placeholder{
  color: rgba(200,180,150,0.45) !important;
  font-weight: 500;
}

/* 16) СЕЛЕКТ-ОПЦИИ (background) */
body[data-theme="4"] select option{
  background: #0f1319 !important;
  color: rgba(243,245,247,0.92) !important;
}

/* Применяем микро-анимации на интерактивные элементы */
/* ultra-glow только на карточках главного экрана, не в модалках */
body[data-theme="4"] #d-list .br,
body[data-theme="4"] .sb .br {
  animation: ultra-glow 4s ease-in-out infinite;
}

/* в модалках — без анимации */
body[data-theme="4"] .mc .br {
  animation: none;
}

/* =========================================================

/* ================================================================
   КАТЕГОРИИ — ПЕРЕОПРЕДЕЛЕНИЕ (САМЫЙ ВЫСОКИЙ ПРИОРИТЕТ)
   ================================================================ */

body[data-theme="4"] .cat-item,
body[data-theme="4"] #box-cats .ci,
body[data-theme="4"] #list .ci,
body[data-theme="4"] .cat-btn,
body[data-theme="4"] [class*="cat"] {
  color: rgba(255,255,255,0.86) !important;
}

body[data-theme="4"] .cat-item p,
body[data-theme="4"] .cat-item h3,
body[data-theme="4"] .cat-item span {
  color: rgba(255,255,255,0.86) !important;
}

/* ВСЕ INPUT И SEARCH ВЕЗДЕ */
body[data-theme="4"] input[type="text"],
body[data-theme="4"] input[type="search"],
body[data-theme="4"] input[placeholder*="категор"],
body[data-theme="4"] input[placeholder*="сумм"],
body[data-theme="4"] input[placeholder*="Введ"] {
  color: rgba(255,255,255,0.86) !important;
  border-color: rgba(255,211,106,0.22) !important;
}

body[data-theme="4"] input[placeholder*="категор"]::placeholder,
body[data-theme="4"] input[placeholder*="сумм"]::placeholder,
body[data-theme="4"] input[placeholder*="Введ"]::placeholder {
  color: rgba(255,255,255,0.55) !important;
}

/* END ПЕРЕОПРЕДЕЛЕНИЕ */

   🏆 БЛОКИ КАТЕГОРИЙ — ULTRA PREMIUM (как главный экран)
   ========================================================= */

/* ЗВЁЗДЫ в категориях */
body[data-theme="4"] .cat-item::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 15% 10%, rgba(255,255,255,0.8), transparent 1px),
    radial-gradient(1px 1px at 85% 90%, rgba(255,211,106,0.6), transparent 1px),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.4), transparent 1px);
  pointer-events: none;
  opacity: 0.3;
  z-index: 1;
  border-radius: inherit;
}

/* Базовый стиль блока категории */
body[data-theme="4"] .cat-item{
  position: relative;
  overflow: hidden;
  
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(180deg, #0c0f14 0%, #06080c 100%) !important;
  
  border: 1px solid rgba(255,211,106,0.18) !important; /* тонкий ободок */
  
  box-shadow:
    /* слой 1: абсолютная тень (космос) */
    0 32px 64px rgba(0,0,0,0.92),
    /* слой 2: золото-аура */
    0 0 24px rgba(255,211,106,0.12),
    /* слой 3: холодная граница */
    inset 0 2px 6px rgba(255,255,255,0.08),
    /* слой 4: плотный низ */
    inset 0 -4px 12px rgba(0,0,0,0.88),
    /* слой 5: ювелирный кант */
    0 0 0 1px rgba(255,211,106,0.24) !important;
  
  transition:
    border-color 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.25s ease-out !important;
}

/* При наведении — золото светлеет */
body[data-theme="4"] .cat-item:hover{
  border-color: rgba(255,211,106,0.32) !important;
  box-shadow:
    0 28px 60px rgba(255,211,106,0.12),
    0 28px 60px rgba(0,0,0,0.80),
    inset 0 2px 8px rgba(255,255,255,0.07),
    inset 0 -4px 12px rgba(0,0,0,0.82),
    0 0 0 1px rgba(0,0,0,0.50) inset !important;
}

/* При нажатии — потолще ободок (видно что нажали) */
body[data-theme="4"] .cat-item:active,
body[data-theme="4"] .cat-item.active{
  border: 2px solid rgba(255,211,106,0.45) !important;
  box-shadow:
    0 28px 60px rgba(255,211,106,0.15),
    0 28px 60px rgba(0,0,0,0.80),
    inset 0 2px 8px rgba(255,255,255,0.08),
    inset 0 -4px 12px rgba(0,0,0,0.85),
    0 0 0 3px rgba(255,211,106,0.18) !important;
  transform: scale(0.98);
}

/* Текст в категориях — премиум (как поиск контрагента) */
body[data-theme="4"] .cat-item,
body[data-theme="4"] .cat-item p,
body[data-theme="4"] .cat-item h3{
  color: rgba(255,255,255,0.86) !important;
}

/* ================================================================
   КАТЕГОРИИ BOX-CATS — ПРЯМОЕ ПЕРЕОПРЕДЕЛЕНИЕ 🎯
   ================================================================ */

body[data-theme="4"] #box-cats,
body[data-theme="4"] #box-cats .ci,
body[data-theme="4"] .cg,
body[data-theme="4"] .cg .ci {
  color: rgba(255,255,255,0.86) !important;
  border-color: rgba(255,211,106,0.22) !important;
}

body[data-theme="4"] #box-cats .ci,
body[data-theme="4"] .cg .ci {
  background: rgba(14,16,19,0.72) !important;
  border: 1px solid rgba(255,211,106,0.22) !important;
}

body[data-theme="4"] #box-cats .ci p,
body[data-theme="4"] #box-cats .ci h3,
body[data-theme="4"] #box-cats .ci span,
body[data-theme="4"] .cg .ci p,
body[data-theme="4"] .cg .ci h3,
body[data-theme="4"] .cg .ci span {
  color: rgba(255,255,255,0.86) !important;
}

/* END BOX-CATS */

/* ================================================================
   INPUT ПОИСК КАТЕГОРИИ — СИНХРОНИЗИРОВАН С ПОИСКОМ КОНТРАГЕНТА
   ================================================================ */

body[data-theme="4"] #search-input {
  color: rgba(255,255,255,0.86) !important;
  border-color: rgba(255,211,106,0.22) !important;
  background: rgba(10,12,15,0.72) !important;
}

body[data-theme="4"] #search-input::placeholder {
  color: rgba(255,255,255,0.55) !important;
}

body[data-theme="4"] #search-input:focus {
  border-color: rgba(255,211,106,0.22) !important;
  box-shadow: 0 0 0 1px rgba(255,211,106,0.18), 0 0 0 4px rgba(255,211,106,0.10) !important;
}

/* END INPUT ПОИСК */

/* =========================================================
   🏆 КОНЕЦ: БЛОКИ КАТЕГОРИЙ ULTRA PREMIUM
   ========================================================= */
/* =========================================================
   НАЧАЛО ПАТЧА: OBSIDIAN — PREMIUM ACTIVE RING (MB + TYPES + CATS)
   Цель: как у идеального ободка категории (.ci.s), но для:
   1) Личное/Бизнес (кнопки .mb в верхнем тумблере)
   2) Расход/Приход (кнопки .mb в модалке #m-add)
   3) Категории (у тебя уже ок, оставляем как есть)
   Важно: без смены текста/заливки (чтобы не ломать цифры/контент).
   ========================================================= */

/* 0) База для всех .mb в обсидиане — спокойная, читабельная, без тяжёлых анимаций */
body[data-theme="4"] .tgl .mb{
  border: 1px solid rgba(255,211,106,0.12) !important;
  background: rgba(14,16,19,0.60) !important;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease !important;
  will-change: transform;
}

/* 1) АКТИВНАЯ КНОПКА (Личное/Бизнес и Расход/Приход) — тот же “ювелирный ободок” как у категории */
body[data-theme="4"] .tgl .mb.a{
  border-color: rgba(255,211,106,0.58) !important;

  /* “ювелирная нить” + мягкий ореол снаружи (как ты одобрил на категориях) */
  box-shadow:
    0 0 0 1px rgba(255,211,106,0.22),
    0 0 18px rgba(255,211,106,0.14),
    0 10px 26px rgba(0,0,0,0.60) !important;

  transform: translateY(-1px) !important;
}

/* 2) Нажатие — лёгкое, без “вязкости” и без тяжёлых теней */
body[data-theme="4"] .tgl .mb:active{
  transform: translateY(0px) scale(0.99) !important;
}

/* 3) Категории в модалке — оставляем твой идеальный стиль (не трогаем текст/фон) */
body[data-theme="4"] #m-add #box-cats.cg .ci{
  border: 1px solid rgba(255,211,106,0.12) !important;
}

body[data-theme="4"] #m-add #box-cats.cg .ci.s{
  border-color: rgba(255,211,106,0.58) !important;
  box-shadow:
    0 0 0 1px rgba(255,211,106,0.22),
    0 0 18px rgba(255,211,106,0.14),
    0 10px 26px rgba(0,0,0,0.60) !important;
}

/* =========================================================
   КОНЕЦ ПАТЧА
   ========================================================= */
   /* =====================================================
   OBSIDIAN — FORCE ACTIVE RING FOR INCOME / EXPENSE
   (ПРИХОД / РАСХОД — ЖЁСТКО)
   ===================================================== */

/* База */
body[data-theme="4"] #m-add button{
  border: 1px solid rgba(255,211,106,0.12) !important;
}

/* Активное состояние через aria-pressed */
body[data-theme="4"] #m-add button[aria-pressed="true"]{
  border-color: rgba(255,211,106,0.60) !important;

  box-shadow:
    0 0 0 1px rgba(255,211,106,0.22),
    0 0 18px rgba(255,211,106,0.14),
    0 10px 26px rgba(0,0,0,0.60) !important;
}

/* Актив через .a */
/* =====================================================
   OBSIDIAN — STRONG ACTIVE RING FOR INCOME / EXPENSE
   ===================================================== */

body[data-theme="4"] #m-add button.a{

  border-color: rgba(255,211,106,0.78) !important;

  box-shadow:
    0 0 0 1px rgba(255,211,106,0.38),
    0 0 26px rgba(255,211,106,0.22),
    0 12px 28px rgba(0,0,0,0.65) !important;

}

box-shadow:
    0 0 0 1px rgba(255,211,106,0.22),
    0 0 18px rgba(255,211,106,0.14),
    0 10px 26px rgba(0,0,0,0.60) !important;
}
/* =====================================================
   OBSIDIAN PERFORMANCE FIX
   Убираем лаги и дергание
   ===================================================== */

/* 1) Запрещаем transition: all */
body[data-theme="4"] *{
  transition-property: border-color, box-shadow, transform, background-color, color !important;
}

/* 2) Упрощаем glow (GPU легче) */
body[data-theme="4"] .mb.a,
body[data-theme="4"] .ci.s,
body[data-theme="4"] #m-add button.a{
  box-shadow:
    0 0 0 1px rgba(255,211,106,0.25),
    0 8px 18px rgba(0,0,0,0.55) !important;
}

/* 3) Убираем тяжелые inset если есть */
body[data-theme="4"] .mb,
body[data-theme="4"] .ci{
  box-shadow:
    0 8px 18px rgba(0,0,0,0.55) !important;
}

/* 4) Говорим браузеру что двигается только transform */
body[data-theme="4"] .mb,
body[data-theme="4"] .ci,
body[data-theme="4"] .rb{
  will-change: transform;
}

/* КОНЕЦ ПАТЧА: THEME 4 — DATA+GOAL MODALS NO GLOW / NO GLASS / NO FLICKER (ANDROID) */

/* ✅ ФИХ: скролл #m-data в Obsidian теме
   Причина бага: body[data-theme="4"] #m-data * { animation:none !important }
   убивает -webkit-overflow-scrolling на Android.
   Решение: явно восстанавливаем скролл с максимальным приоритетом */
body[data-theme="4"] #m-data .mc {
  overflow-y: scroll !important;      /* scroll надёжнее auto на Android */
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

/* mrg-report — маржа внутри .mc тоже должна быть видна полностью */
body[data-theme="4"] #m-data #mrg-report {
  overflow: visible !important;
  max-height: none !important;
}

/* НАЧАЛО ПАТЧА: PLACEHOLDER COLOR — SEARCH INPUT + DEBT SEARCH */
body[data-theme="4"] #search-input::placeholder,
body[data-theme="4"] #search-debt::placeholder{
  color: rgba(255,211,106,0.26) !important;
}

/* КОНЕЦ ПАТЧА: PLACEHOLDER COLOR — SEARCH INPUT + DEBT SEARCH */
/* НАЧАЛО ПАТЧА: INPUT TEXT COLOR SYNC (MAIN + DEBT SEARCH) */
body[data-theme="4"] #search-input,
body[data-theme="4"] #search-debt{
  color: rgba(255,255,255,0.92) !important;     /* введённый текст */
  caret-color: rgba(255,211,106,0.75) !important;/* курсор */
}

/* [E] THEME 4 OBSIDIAN */
body[data-theme="4"] #m-add .in-field#due-date-wrap {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

body[data-theme="4"] #m-add .in-field#due-date-wrap .in-field-label {
  color: rgba(243,245,247,0.55) !important;
}

body[data-theme="4"] #m-add .in-field#due-date-wrap > input {
  color: rgba(243,245,247,0.95) !important;
  -webkit-text-fill-color: rgba(243,245,247,0.95) !important;
}

body[data-theme="4"] #m-add .in-field#due-date-wrap input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.05) !important;
}

/* theme 4 exact fix */
body[data-theme="4"] #m-add .ship-exp-row{
  min-height: 0 !important;
  height: auto !important;
  padding: 6px 10px !important;
  border-radius: 14px !important;
}

body[data-theme="4"] #m-add .ship-exp-row-text{
  font-size: 13px !important;
  line-height: 1.1 !important;
}

body[data-theme="4"] #m-add .ship-exp-row-reconcile{
  font-size: 10px !important;
  max-width: 92px !important;
}

body[data-theme="4"] #m-add .ship-exp-row-toggle{
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
}

body[data-theme="4"] #m-add .ship-exp-row-toggle-text{
  font-size: 10px !important;
  line-height: 1 !important;
}

body[data-theme="4"] #m-add .ship-exp-row-del{
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
}

/* ===== THEME 4 FIX ===== */
body[data-theme="4"] #m-add .ship-exp-row{
  min-height:44px !important;
  padding:8px 10px !important;
  gap:8px !important;
  overflow:visible !important;
}

body[data-theme="4"] #m-add .ship-exp-row-left{
  flex:1 1 auto !important;
  min-width:0 !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  overflow:hidden !important;
}

body[data-theme="4"] #m-add .ship-exp-row-text{
  flex:1 1 auto !important;
  min-width:0 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  font-size:14px !important;
  font-weight:700 !important;
  color:rgba(243,245,247,.92) !important;
}

body[data-theme="4"] #m-add .ship-exp-row-reconcile{
  flex:0 0 auto !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:6px !important;
  margin-left:6px !important;
  padding:0 !important;
  font-size:11px !important;
  font-weight:700 !important;
  color:rgba(243,245,247,.78) !important;
  white-space:nowrap !important;
  max-width:110px !important;
}

body[data-theme="4"] #m-add .ship-exp-row-toggle{
  width:15px !important;
  height:15px !important;
  min-width:15px !important;
  min-height:15px !important;
  margin:0 !important;
  accent-color:#E7B95A !important;
  transform:none !important;
  filter:none !important;
  box-shadow:none !important;
  flex:0 0 auto !important;
}

body[data-theme="4"] #m-add .ship-exp-row-toggle-text{
  font-size:11px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

body[data-theme="4"] #m-add .ship-exp-row-del{
  margin-left:4px !important;
  flex:0 0 auto !important;
}

body[data-theme="4"] #fish-logic > .br,
body[data-theme="4"] #btn-ship-exp-add,
body[data-theme="4"] #extra-fish-logic > .br,
body[data-theme="4"] #btn-extra-exp{
  color: #F6F7F8 !important;
  -webkit-text-fill-color: #F6F7F8 !important;
  border: 1px solid rgba(231,185,90,0.24) !important;
  background: rgba(22,24,28,0.98) !important;
  box-shadow:
    0 12px 28px rgba(0,0,0,0.58),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(231,185,90,0.08) !important;
}

/* ── Тема 3: синяя / золото ── */

/* ── Тема 4: deep space premium ── */
body[data-theme="4"] #tgl-mode {
  background: rgba(0, 0, 0, 0.32) !important;
  border-color: rgba(255, 211, 106, 0.08) !important;
}

body[data-theme="4"] #tgl-mode .mb.a {
  background: linear-gradient(135deg, #82BCE0, #4a9ec7) !important;
  background-image: none !important;
  box-shadow:
    0 3px 14px rgba(130, 188, 224, 0.38),
    0 0 22px rgba(130, 188, 224, 0.15) !important;
}

/* ── THEME 4 (Obsidian Gold): muted текст — поднять читаемость ── */
body[data-theme="4"] .muted,
body[data-theme="4"] .sub-label,
body[data-theme="4"] .greeting,
body[data-theme="4"] .sb small,
body[data-theme="4"] .goal-name {
  color: rgba(244, 246, 248, 0.68) !important;
}

/* ====== END THEME 2/5 .in-field#ship-date-wrap FULL OVERRIDE ====== */

/* ====== THEME 4: ship-date-wrap — все тёмные стили только здесь ====== */
body[data-theme="4"] #m-add .in-field#ship-date-wrap {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

body[data-theme="4"] #m-add .in-field#ship-date-wrap .in-field-label,
body[data-theme="4"] #ship-date-wrap .in-field-label {
  color: rgba(243,245,247,0.55) !important;
}

body[data-theme="4"] #m-add .in-field#ship-date-wrap input,
body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #ship-date-wrap > input,
body[data-theme="4"] #ship-date-wrap input {
  color: rgba(243,245,247,0.92) !important;
  -webkit-text-fill-color: rgba(243,245,247,0.92) !important;
}

body[data-theme="4"] #m-add .in-field#ship-date-wrap::after {
  color: rgba(243,245,247,0.45) !important;
}

body[data-theme="4"] #ship-date-wrap {
  background: rgba(255,255,255,0.04) !important;
}

/* НАЧАЛО ПАТЧА: THEME 4 — DATA+GOAL MODALS NO GLOW / NO GLASS / NO FLICKER (ANDROID) */

@media (pointer: coarse){

  /* 1) В этих двух модалках убираем любые намёки на стекло и тяжёлые эффекты */
  body[data-theme="4"] #m-data.md,
  body[data-theme="4"] #m-goal.md{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0,0,0,0.84) !important; /* плотный фон, без стекла */
  }

  body[data-theme="4"] #m-data .mc,
  body[data-theme="4"] #m-goal .mc{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(7,8,10,0.96) !important;  /* плотный “лак” */
    background-image: none !important;         /* убираем переливы */
    box-shadow: 0 22px 56px rgba(0,0,0,0.85) !important; /* 1 тень, дешево */
  }

  /* 2) Шапка: чтобы не было “просвета” и мигания из-за inherit */
  body[data-theme="4"] #m-data .mc-top,
  body[data-theme="4"] #m-goal .mc-top{
    background: rgba(7,8,10,0.98) !important;
    background-image: none !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255,211,106,0.14) !important;
  }

  /* 3) УБИРАЕМ ПОДСВЕТЫ (ореолы) на кнопках внутри этих модалок */
  body[data-theme="4"] #m-data .br,
  body[data-theme="4"] #m-goal .br,
  body[data-theme="4"] #m-data .mini,
  body[data-theme="4"] #m-goal .mini{
    background: rgba(10,12,15,0.96) !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.65) !important; /* без ауры */
  }

  /* 4) Поля ввода в “Цели”: убираем стекло/свечения */
  body[data-theme="4"] #m-goal input,
  body[data-theme="4"] #m-goal textarea,
  body[data-theme="4"] #m-goal select{
    background: rgba(14,16,19,0.92) !important;
    background-image: none !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 22px rgba(0,0,0,0.55) !important;
  }

/* 5) Ключ от мигания: на телефоне гасим переходы именно в этих модалках */
body[data-theme="4"] #m-data,
body[data-theme="4"] #m-goal,
body[data-theme="4"] #m-data * ,
body[data-theme="4"] #m-goal *{
  transition: none !important;
  animation: none !important;
}
  /* 6) И отдельно: нажатие без фильтра яркости (filter = лаги) */
  body[data-theme="4"] #m-data .br:active,
  body[data-theme="4"] #m-goal .br:active,
  body[data-theme="4"] #m-data .mini:active,
  body[data-theme="4"] #m-goal .mini:active{
    filter: none !important;
  }
}

/* НАЧАЛО ПАТЧА: THEME 4 — HARD KILL GLASS (MOBILE, GLOBAL) */
@media (pointer: coarse){
  /* Убираем “просвет” (альфа) — именно он даёт эффект стекла */
  body[data-theme="4"] .md,
  body[data-theme="4"] .m{
    background: rgba(0,0,0,0.92) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body[data-theme="4"] .md .mc,
  body[data-theme="4"] .m .mc,
  body[data-theme="4"] .an-card,
  body[data-theme="4"] .cd,
  body[data-theme="4"] .mb,
  body[data-theme="4"] .ci,
  body[data-theme="4"] .ii{
    background: rgba(7,8,10,1) !important;   /* 1 = без стекла */
    background-image: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* КОНЕЦ ПАТЧА: THEME 4 — HARD KILL GLASS (MOBILE, GLOBAL) */
/* НАЧАЛО ПАТЧА: ТЕМА 4 — ДОБИТЬ СТЕКЛО ВЕЗДЕ (ТОЛЬКО ТЕЛЕФОН) */
@media (pointer: coarse){

  /* 1) Глобально вырубаем размытие в теме 4, где бы оно ни пряталось */
  body[data-theme="4"] *,
  body[data-theme="4"] *::before,
  body[data-theme="4"] *::after{
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* 2) Делает “плотный лак” вместо стекла для основных блоков */
  body[data-theme="4"] .md,
  body[data-theme="4"] .m{
    background: rgba(0,0,0,0.92) !important;
  }

  body[data-theme="4"] .mc,
  body[data-theme="4"] .cd,
  body[data-theme="4"] .mb,
  body[data-theme="4"] .ci,
  body[data-theme="4"] .ii,
  body[data-theme="4"] .an-card,
  body[data-theme="4"] .search-box,
  body[data-theme="4"] .rb,
  body[data-theme="4"] .br,
  body[data-theme="4"] .mini,
  body[data-theme="4"] .cat-btn{
    background: rgba(7,8,10,1) !important;   /* 1 = без стекла */
    background-image: none !important;
  }

  /* 3) Убираем “ореолы” и тяжёлые подсветы (часто выглядят как стекло) */
  body[data-theme="4"] .cd,
  body[data-theme="4"] .mb,
  body[data-theme="4"] .ci,
  body[data-theme="4"] .ii,
  body[data-theme="4"] .an-card,
  body[data-theme="4"] .rb,
  body[data-theme="4"] .br,
  body[data-theme="4"] .mini,
  body[data-theme="4"] .cat-btn{
    filter: none !important;
    box-shadow: 0 14px 34px rgba(0,0,0,0.78) !important;
  }
}

/* ══════════════════════════════════════════
   UNIVERSAL MODAL GAP — единый отступ 10px
   Заменяет разрозненные margin на flex gap
   ══════════════════════════════════════════ */
body[data-theme="4"] #m-add .mc {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
/* Обнуляем все индивидуальные margin у прямых детей */
body[data-theme="4"] #m-add .mc > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
/* Исключение: кнопки Сохранить/Отмена — небольшой отступ между ними */
body[data-theme="4"] #m-add .mc > .br.primary { margin-top: 4px !important; }
body[data-theme="4"] #m-add .mc > .br.ghost   { margin-top: 0 !important; }
/* fpeFieldGap → 0 (gap делает .mc) */
body[data-theme="4"] #m-add { --fpeFieldGap: 0px !important; }

/* ══════ ИСКЛЮЧЕНИЯ ДЛЯ GAP PATCH ══════ */
/* 1. Накладная/ОБЩАЯ СУММА — восстановить отступ снизу чтобы не перекрывала заголовок */
body[data-theme="4"] #m-add .mc > #ship-doc-preview.doc {
  margin-bottom: 20px !important;
}
/* 2. Контейнеры дат — overflow visible чтобы не обрезало содержимое */
body[data-theme="4"] #m-add .in-field#ship-date-wrap,
body[data-theme="4"] #m-add .in-field#due-date-wrap {
  overflow: visible !important;
  min-height: var(--fpeCtlH, 54px) !important;
}
/* 3. Дата — явный цвет и color-scheme для контраста */
body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #m-add .in-field#due-date-wrap > input {
  color: var(--text) !important;
  color-scheme: dark !important;
}

/* ══════════════════════════════════════════════════════════
   УНИФИКАЦИЯ СТИЛЯ ФОРМ — тема 4 (Obsidian)
   border-radius: 18px для секций, 16px для полей
   gap: 10px везде (уже задан через UNIVERSAL MODAL GAP)
   ══════════════════════════════════════════════════════════ */

/* 1. ship-doc-preview — отступ СВЕРХУ чтобы не налезал на "Новая запись"
      Flex gap не работает перед первым видимым дочерним элементом */
body[data-theme="4"] #m-add .mc > #ship-doc-preview.doc {
  margin-top: 10px !important;
  margin-bottom: 16px !important;
  border-radius: 18px !important;
  padding: 12px !important;
}

/* 2. Секция рыбы (Отгрузка/Закупка) — единый радиус */
body[data-theme="4"] #m-add #fish-logic {
  border-radius: 18px !important;
  padding: 14px !important;
  margin-bottom: 0 !important;
}

/* 3. Секция расходов — единый радиус */
body[data-theme="4"] #m-add #ship-expenses {
  border-radius: 18px !important;
  padding: 14px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* 4. Контейнеры полей ввода (.in-field) — единый радиус */
body[data-theme="4"] #m-add .in-field,
body[data-theme="4"] #m-add #ship-date-wrap,
body[data-theme="4"] #m-add #due-date-wrap {
  border-radius: var(--form-radius) !important;
}

/* 5. Кнопка контрагента — уже 18px, подтверждаем */
body[data-theme="4"] #m-add .contr-pick-btn {
  border-radius: var(--form-radius) !important;
}

/* 6. Обнуляем --fpe-radius чтобы он соответствовал нашим значениям */
body[data-theme="4"] #m-add {
  --fpe-radius: 16px !important;
}


/* ══════════════════════════════════════════════════════
   ALIGN — Obsidian theme 4
   ══════════════════════════════════════════════════════ */

/* Комментарий (#i-desc) — border-radius 16px как у .in-field
   (глобальный input имеет 18px, выравниваем под остальные поля) */
body[data-theme="4"] #m-add #i-desc {
  border-radius: 16px !important;
  padding: 14px 16px !important;
}

/* ══════════════════════════════════════════════════════
   ДОБОР (#m-extra) — Obsidian theme 4
   Gap и размеры контейнеров = как в #m-add .mc
   ══════════════════════════════════════════════════════ */

/* Flex gap 10px — как в #m-add .mc */
body[data-theme="4"] #m-extra .mc {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
body[data-theme="4"] #m-extra .mc > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Рыба и расходы — border-radius 18px как в #m-add */
body[data-theme="4"] #m-extra #extra-fish-logic,
body[data-theme="4"] #m-extra #extra-exp-wrap {
  border-radius: 18px !important;
  padding: 14px !important;
}

/* Инпут дат в #m-extra — border-radius 16px как у .in-field в #m-add
   Контейнер .in-date намеренно "голый" (modals.css: padding:0, background:none) */
body[data-theme="4"] #m-extra .in-date input {
  border-radius: 16px !important;
}

/* Комментарий #e-comm — border-radius 16px */
body[data-theme="4"] #m-extra #e-comm {
  border-radius: 16px !important;
  padding: 14px 16px !important;
}

/* ══════════════════════════════════════════════════════
   CSS-переменные форм — Obsidian (theme 4)
   Единая точка управления стилями контейнеров
   ══════════════════════════════════════════════════════ */
body[data-theme="4"] {
  --form-radius: 18px;
  --form-padding: 14px 16px;
  --form-gap: 10px;
  --form-bg: rgba(22,24,28,0.96);
  --form-border: 1px solid rgba(255,211,106,0.18);
  --form-color: var(--text);
  --form-shadow: inset 3px 3px 8px rgba(0,0,0,0.4), inset -2px -2px 6px rgba(255,255,255,0.03);
}

/* ── Единый фон для всех полей ввода #m-add в теме 4 ────────────────
   style.css дает #m-add input { background: var(--card-bg) } spec(1,0,1)
   Здесь spec(1,1,2) побеждает и унифицирует с контейнерами.
   Инпуты внутри date-wraps остаются прозрачными (spec выше). */
body[data-theme="4"] #m-add select,
body[data-theme="4"] #m-add input,
body[data-theme="4"] #m-add textarea {
  background: var(--form-bg) !important;
}

/* ── Даты: контейнер прозрачный, фон на инпуте внутри ─────────────
   Убираем двойной слой: контейнер рисовал фон + рамку, инпут — свой.
   Теперь: контейнер = невидимый, инпут = стиль от темы (как в Доборе). */
body[data-theme="4"] #m-add .in-field#ship-date-wrap,
body[data-theme="4"] #m-add .in-field#due-date-wrap,
body[data-theme="4"] #m-add #ship-date-wrap,
body[data-theme="4"] #m-add #due-date-wrap {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Инпут внутри: полный стиль темы */
body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #m-add .in-field#ship-date-wrap input,
body[data-theme="4"] #m-add .in-field#due-date-wrap > input,
body[data-theme="4"] #m-add .in-field#due-date-wrap input,
body[data-theme="4"] #m-add #ship-date-wrap input,
body[data-theme="4"] #m-add #due-date-wrap input {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  border-radius: var(--form-radius) !important;
}

/* ══ Даты: структура как в Доборе (#extra-date-wrap) ══
   Контейнер — прозрачный враппер, инпут — в нормальном потоке со стилем темы.
   Spec контейнера (2,2,1) > все предыдущие; инпута (2,2,2) > style.css transparent (2,1,1). */

/* 1. Контейнер: сбрасываем всё как в Доборе */
body[data-theme="4"] #m-add .in-field#ship-date-wrap,
body[data-theme="4"] #m-add .in-field#due-date-wrap,
body[data-theme="4"] #m-add #ship-date-wrap,
body[data-theme="4"] #m-add #due-date-wrap {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* 2. Инпут: в потоке (не absolute), полный стиль темы */
body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #m-add .in-field#ship-date-wrap input,
body[data-theme="4"] #m-add .in-field#due-date-wrap > input,
body[data-theme="4"] #m-add .in-field#due-date-wrap input,
body[data-theme="4"] #m-add #ship-date-wrap input,
body[data-theme="4"] #m-add #due-date-wrap input {
  position: relative !important;
  width: 100% !important;
  height: var(--fpeCtlH) !important;
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  border-radius: var(--form-radius) !important;
  padding: 0 var(--fpeCtlPadX, 16px) !important;
  box-sizing: border-box !important;
}

/* 3. Лейбл дат не перекрывает текст — padding-top под абсолютный .in-field-label */
body[data-theme="4"] #m-add #ship-date-wrap input,
body[data-theme="4"] #m-add #due-date-wrap input {
  padding-top: 36px !important;
  padding-bottom: 8px !important;
}

/* ══ Унификация контейнеров форм — тема 4 (Obsidian) ══════════════
   Все поля и секции #m-add/#m-extra получают единые border/shadow/bg
   через CSS-переменные --form-*, как у .in-field и .contr-pick-btn.
   ══════════════════════════════════════════════════════════════════ */

/* 1. Bare inputs/selects в #m-add — border и shadow через --form-*
   spec (1,1,1): побеждает style.css #m-add input (1,0,1) и FPE (1,0,1).
   Не затрагивает date-wrap inputs — их правила (2,2,2) выше. */
body[data-theme="4"] #m-add select,
body[data-theme="4"] #m-add input,
body[data-theme="4"] #m-add textarea {
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

/* 2. Секция рыбы — сбрасываем --ring/--aura, используем --form-* */
body[data-theme="4"] #m-add #fish-logic {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

/* 3. Секция расходов — сбрасываем linear-gradient, используем --form-*
   spec (2,1,0) побеждает body[data-theme="4"] #m-add .ship-exp (1,2,0). */
body[data-theme="4"] #m-add #ship-expenses {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

/* 4. #m-extra секции — такой же стиль как в #m-add */
body[data-theme="4"] #m-extra #extra-fish-logic,
body[data-theme="4"] #m-extra #extra-exp-wrap {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

/* ── #i-desc (Комментарий) — border и shadow через --form-* ─────── */
body[data-theme="4"] #m-add #i-desc {
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
}

/* ── Кнопки "Добавить товар" и "Добавить расход" — унификация ───────
   Охватываем обе формы (#m-add и #m-extra), используем --form-*.
   spec (2,1,1) > существующего (1,1,1) → побеждает. */
body[data-theme="4"] #m-add #fish-logic > .br,
body[data-theme="4"] #m-add #ship-expenses .br,
body[data-theme="4"] #m-add #btn-ship-exp-add,
body[data-theme="4"] #m-extra #extra-fish-logic > .br,
body[data-theme="4"] #m-extra #extra-exp-wrap .br,
body[data-theme="4"] #m-extra #btn-extra-exp {
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  border-radius: var(--form-radius) !important;
  height: var(--fpeBtnH, 52px) !important;
}

/* ── padding-top ФИКС 2: spec (2,2,1) > конкурент (2,2,1) по порядку файла ──
   Конкурент: body[t4] #m-add .in-field#ship-date-wrap input { padding: 0 16px }
   Этот блок стоит ПОЗЖЕ в файле → при равном spec с !important побеждает. */
body[data-theme="4"] #m-add .in-field#ship-date-wrap input,
body[data-theme="4"] #m-add .in-field#due-date-wrap input {
  padding-top: 36px !important;
  padding-bottom: 8px !important;
}

/* ── #i-desc (Комментарий): видимый ободок ──────────────────────────────────
   --form-border = rgba(255,211,106,0.18) = 18% — слишком прозрачно.
   Используем 50% непрозрачность — видимо, но в тональности темы.
   spec(2,1,0) побеждает все конкурирующие !important rules (spec ≤ 1,1,1). */
body[data-theme="4"] #m-add #i-desc {
  border: 1px solid rgba(255,211,106,0.50) !important;
  box-shadow: var(--form-shadow) !important;
}

/* =========================================================
   FIX: date fields normal-flow geometry for theme 4
   Причина: legacy style.css задавал date inputs через
   position:absolute + bottom/left/right. При переходе на
   relative старые inset-значения продолжали сдвигать поле.
   Здесь полностью сбрасываем inset/transform и возвращаем
   даты в нормальный поток, чтобы не было overlap/layering.
   ========================================================= */
body[data-theme="4"] #m-add .in-field#ship-date-wrap,
body[data-theme="4"] #m-add .in-field#due-date-wrap,
body[data-theme="4"] #m-add #ship-date-wrap,
body[data-theme="4"] #m-add #due-date-wrap {
  position: relative !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #m-add .in-field#ship-date-wrap input,
body[data-theme="4"] #m-add .in-field#due-date-wrap > input,
body[data-theme="4"] #m-add .in-field#due-date-wrap input,
body[data-theme="4"] #m-add #ship-date-wrap input,
body[data-theme="4"] #m-add #due-date-wrap input {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  width: 100% !important;
  height: var(--fpeCtlH, 54px) !important;
  min-height: var(--fpeCtlH, 54px) !important;
  line-height: normal !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 30px var(--fpeCtlPadX, 16px) 8px var(--fpeCtlPadX, 16px) !important;
  background: var(--form-bg) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  border-radius: var(--form-radius) !important;
}

body[data-theme="4"] #m-add .in-field#ship-date-wrap .in-field-label,
body[data-theme="4"] #m-add .in-field#due-date-wrap .in-field-label,
body[data-theme="4"] #m-add #ship-date-wrap .in-field-label,
body[data-theme="4"] #m-add #due-date-wrap .in-field-label {
  position: absolute !important;
  top: 10px !important;
  left: var(--fpeCtlPadX, 16px) !important;
  right: 56px !important;
  z-index: 2 !important;
  pointer-events: none !important;
}


/* =========================================================
   FISHKA FIX v2 — add/edit modal geometry cleanup, theme 4
   Цель:
   1) вернуть #i-meth ("Наличные") в красивый контейнер;
   2) убрать видимые горизонтальные линии от старых border/underlines;
   3) выровнять date fields + comment + buttons без overlap.
   ========================================================= */

body[data-theme="4"] #m-add .mc {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

body[data-theme="4"] #m-add .mc > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Контейнер выбора контрагента/оплаты: ровная колонка */
body[data-theme="4"] #m-add #debt-options:not(.h) {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
}

/* Возвращаем "Наличные" как полноценный premium-control */
body[data-theme="4"] #m-add #debt-options #i-meth {
  display: block !important;
  width: 100% !important;
  height: var(--fpeCtlH, 54px) !important;
  min-height: var(--fpeCtlH, 54px) !important;
  box-sizing: border-box !important;

  margin: 0 !important;
  padding: 0 46px 0 var(--fpeCtlPadX, 16px) !important;

  color: var(--form-color, #F7EFE1) !important;
  font-size: var(--fpeFont, 15px) !important;
  font-weight: 700 !important;
  line-height: normal !important;

  border-radius: var(--form-radius, 18px) !important;
  border: var(--form-border, 1px solid rgba(255,211,106,0.18)) !important;
  box-shadow: var(--form-shadow) !important;

  -webkit-appearance: none !important;
  appearance: none !important;

  background-color: rgba(21,22,24,0.86) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,211,106,.78) 50%),
    linear-gradient(135deg, rgba(255,211,106,.78) 50%, transparent 50%) !important;
  background-position:
    calc(100% - 24px) 50%,
    calc(100% - 18px) 50% !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
}

/* Даты: контейнер только держит геометрию, поле рисует внешний вид */
body[data-theme="4"] #m-add .in-field#ship-date-wrap,
body[data-theme="4"] #m-add .in-field#due-date-wrap,
body[data-theme="4"] #m-add #ship-date-wrap,
body[data-theme="4"] #m-add #due-date-wrap {
  position: relative !important;
  width: 100% !important;
  height: var(--fpeCtlH, 54px) !important;
  min-height: var(--fpeCtlH, 54px) !important;
  flex: 0 0 auto !important;

  margin: 0 !important;
  padding: 0 !important;

  background: transparent !important;
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Убираем старые декоративные линии/псевдослои */
body[data-theme="4"] #m-add .in-field#ship-date-wrap::before,
body[data-theme="4"] #m-add .in-field#ship-date-wrap::after,
body[data-theme="4"] #m-add .in-field#due-date-wrap::before,
body[data-theme="4"] #m-add .in-field#due-date-wrap::after,
body[data-theme="4"] #m-add #ship-date-wrap::before,
body[data-theme="4"] #m-add #ship-date-wrap::after,
body[data-theme="4"] #m-add #due-date-wrap::before,
body[data-theme="4"] #m-add #due-date-wrap::after {
  content: none !important;
  display: none !important;
}

/* Инпуты дат — нормальный поток, без ручного bottom/top */
body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #m-add .in-field#ship-date-wrap input,
body[data-theme="4"] #m-add .in-field#due-date-wrap > input,
body[data-theme="4"] #m-add .in-field#due-date-wrap input,
body[data-theme="4"] #m-add #ship-date-wrap input,
body[data-theme="4"] #m-add #due-date-wrap input {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;

  width: 100% !important;
  height: var(--fpeCtlH, 54px) !important;
  min-height: var(--fpeCtlH, 54px) !important;
  box-sizing: border-box !important;

  margin: 0 !important;
  padding: 30px var(--fpeCtlPadX, 16px) 8px var(--fpeCtlPadX, 16px) !important;

  color: var(--form-color, #F7EFE1) !important;
  background: rgba(21,22,24,0.86) !important;
  border: var(--form-border, 1px solid rgba(255,211,106,0.18)) !important;
  box-shadow: var(--form-shadow) !important;
  border-radius: var(--form-radius, 18px) !important;
}

body[data-theme="4"] #m-add .in-field#ship-date-wrap .in-field-label,
body[data-theme="4"] #m-add .in-field#due-date-wrap .in-field-label,
body[data-theme="4"] #m-add #ship-date-wrap .in-field-label,
body[data-theme="4"] #m-add #due-date-wrap .in-field-label {
  position: absolute !important;
  top: 10px !important;
  left: var(--fpeCtlPadX, 16px) !important;
  right: 56px !important;
  z-index: 2 !important;
  pointer-events: none !important;
  line-height: 1 !important;
}

/* Комментарий не должен налезать на дату */
body[data-theme="4"] #m-add #i-desc {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: var(--fpeCtlH, 54px) !important;
  min-height: var(--fpeCtlH, 54px) !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Кнопки — ниже дат, без наложений */
body[data-theme="4"] #m-add .mc > .br.primary,
body[data-theme="4"] #m-add .mc > .br.ghost {
  position: relative !important;
  display: block !important;
  width: var(--fpeBtnW, 88%) !important;
  height: var(--fpeBtnH, 52px) !important;
  min-height: var(--fpeBtnH, 52px) !important;
  flex: 0 0 auto !important;
  margin: 0 auto !important;
  transform: none !important;
  z-index: 1 !important;
}

body[data-theme="4"] #m-add .mc > .br.primary {
  margin-top: 2px !important;
}


/* =========================================================
   FISHKA FIX v3 — correct field order + modal alignment
   Правильный порядок:
   1) Наличные
   2) Комментарий
   3) Дата отгрузки
   4) Дата оплаты
   5) Сохранить
   6) Отмена
   ========================================================= */

body[data-theme="4"] #m-add .mc {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

body[data-theme="4"] #m-add .mc > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

body[data-theme="4"] #m-add #debt-options:not(.h) {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
}

/* порядок внутри блока оплаты/долга */
body[data-theme="4"] #m-add #debt-options #i-meth {
  order: 1 !important;
}

body[data-theme="4"] #m-add #debt-options #i-desc {
  order: 2 !important;
}

body[data-theme="4"] #m-add #debt-options #ship-date-wrap {
  order: 3 !important;
}

body[data-theme="4"] #m-add #debt-options #due-date-wrap {
  order: 4 !important;
}

/* fallback, если элементы лежат прямыми детьми .mc */
body[data-theme="4"] #m-add .mc #i-meth {
  order: 20 !important;
}

body[data-theme="4"] #m-add .mc #i-desc {
  order: 30 !important;
}

body[data-theme="4"] #m-add .mc #ship-date-wrap {
  order: 40 !important;
}

body[data-theme="4"] #m-add .mc #due-date-wrap {
  order: 50 !important;
}

body[data-theme="4"] #m-add .mc > .br.primary {
  order: 60 !important;
}

body[data-theme="4"] #m-add .mc > .br.ghost {
  order: 70 !important;
}

/* Наличные — полноценный контейнер */
body[data-theme="4"] #m-add #i-meth {
  display: block !important;
  width: 100% !important;
  height: var(--fpeCtlH, 56px) !important;
  min-height: var(--fpeCtlH, 56px) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 46px 0 var(--fpeCtlPadX, 16px) !important;
  line-height: normal !important;
  border-radius: var(--form-radius, 18px) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  background-color: var(--form-bg) !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Комментарий — сразу после Наличные */
body[data-theme="4"] #m-add #i-desc {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: var(--fpeCtlH, 56px) !important;
  min-height: var(--fpeCtlH, 56px) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 var(--fpeCtlPadX, 16px) !important;
  border-radius: var(--form-radius, 18px) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  background: var(--form-bg) !important;
  transform: none !important;
}

/* Даты — отдельные контейнеры ниже комментария */
body[data-theme="4"] #m-add #ship-date-wrap,
body[data-theme="4"] #m-add #due-date-wrap,
body[data-theme="4"] #m-add .in-field#ship-date-wrap,
body[data-theme="4"] #m-add .in-field#due-date-wrap {
  position: relative !important;
  width: 100% !important;
  height: var(--fpeCtlH, 56px) !important;
  min-height: var(--fpeCtlH, 56px) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  transform: none !important;
}

/* Убрать полосы/псевдолинии вокруг дат */
body[data-theme="4"] #m-add #ship-date-wrap::before,
body[data-theme="4"] #m-add #ship-date-wrap::after,
body[data-theme="4"] #m-add #due-date-wrap::before,
body[data-theme="4"] #m-add #due-date-wrap::after,
body[data-theme="4"] #m-add .in-field#ship-date-wrap::before,
body[data-theme="4"] #m-add .in-field#ship-date-wrap::after,
body[data-theme="4"] #m-add .in-field#due-date-wrap::before,
body[data-theme="4"] #m-add .in-field#due-date-wrap::after {
  content: none !important;
  display: none !important;
}

/* Input внутри даты: normal flow, без bottom/top */
body[data-theme="4"] #m-add #ship-date-wrap input,
body[data-theme="4"] #m-add #due-date-wrap input,
body[data-theme="4"] #m-add .in-field#ship-date-wrap > input,
body[data-theme="4"] #m-add .in-field#due-date-wrap > input {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  width: 100% !important;
  height: var(--fpeCtlH, 56px) !important;
  min-height: var(--fpeCtlH, 56px) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 30px var(--fpeCtlPadX, 16px) 8px var(--fpeCtlPadX, 16px) !important;
  border-radius: var(--form-radius, 18px) !important;
  border: var(--form-border) !important;
  box-shadow: var(--form-shadow) !important;
  background: var(--form-bg) !important;
}

body[data-theme="4"] #m-add #ship-date-wrap .in-field-label,
body[data-theme="4"] #m-add #due-date-wrap .in-field-label,
body[data-theme="4"] #m-add .in-field#ship-date-wrap .in-field-label,
body[data-theme="4"] #m-add .in-field#due-date-wrap .in-field-label {
  position: absolute !important;
  top: 10px !important;
  left: var(--fpeCtlPadX, 16px) !important;
  right: 56px !important;
  z-index: 2 !important;
  pointer-events: none !important;
  line-height: 1 !important;
  transform: none !important;
}

/* Кнопки после всех полей */
body[data-theme="4"] #m-add .mc > .br.primary,
body[data-theme="4"] #m-add .mc > .br.ghost {
  position: relative !important;
  display: block !important;
  width: var(--fpeBtnW, 88%) !important;
  height: var(--fpeBtnH, 52px) !important;
  min-height: var(--fpeBtnH, 52px) !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
  transform: none !important;
  z-index: 1 !important;
}

body[data-theme="4"] #m-add .mc > .br.primary {
  margin-top: 2px !important;
}

/* =======================================================
   ПРИХОД / РАСХОД — цвета кнопок фильтра (Obsidian)
   ======================================================= */
body[data-theme="4"] #btn-filter-income,
body[data-theme="4"] #btn-filter-income *,
body[data-theme="4"] #btn-filter-expense,
body[data-theme="4"] #btn-filter-expense * { color: #E8E0CC !important; }

body[data-theme="4"] #btn-filter-income small,
body[data-theme="4"] #btn-filter-income b { color: #4CAF7A !important; }

body[data-theme="4"] #btn-filter-expense small,
body[data-theme="4"] #btn-filter-expense b { color: #E05555 !important; }

body[data-theme="4"] #btn-filter-income.filter-active {
  border-color: rgba(76,175,122,0.75) !important;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.5), -2px -2px 8px rgba(80,80,80,0.2), 0 0 0 2px rgba(76,175,122,0.30) !important;
}
body[data-theme="4"] #btn-filter-expense.filter-active {
  border-color: rgba(224,85,85,0.75) !important;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.5), -2px -2px 8px rgba(80,80,80,0.2), 0 0 0 2px rgba(224,85,85,0.30) !important;
}

body[data-theme="4"] .pl { color: #4CAF7A !important; }
body[data-theme="4"] .mn { color: #E05555 !important; }

/* =======================================================
   СВЕРКА — размеры шрифтов (Obsidian, тема 4)
   ======================================================= */
body[data-theme="4"] .rec-page,
body[data-theme="4"] [class*="rec-"] { font-size: 15px !important; font-weight: 600 !important; }
body[data-theme="4"] .rec-page .sum,
body[data-theme="4"] .rec-page b,
body[data-theme="4"] .rec-page strong { font-size: 16px !important; font-weight: 700 !important; }
body[data-theme="4"] .rec-wrap * { font-size: 15px !important; }
body[data-theme="4"] .rec-wrap .sum,
body[data-theme="4"] .rec-wrap b,
body[data-theme="4"] .rec-wrap strong,
body[data-theme="4"] .rec-wrap .total { font-size: 17px !important; font-weight: 700 !important; }

/* =======================================================
   СВЕРКА — реальные классы, увеличенные шрифты (тема 4)
   ======================================================= */
body[data-theme="4"] .recC { font-size: 14px !important; }
body[data-theme="4"] .recCa { font-size: 18px !important; font-weight: 700 !important; }
body[data-theme="4"] .recCt { font-size: 15px !important; }
body[data-theme="4"] .recCdesc { font-size: 14px !important; }
body[data-theme="4"] .recSt { font-size: 13px !important; }
body[data-theme="4"] .recFishName { font-size: 17px !important; font-weight: 700 !important; }
body[data-theme="4"] .recFishMeta { font-size: 16px !important; }
body[data-theme="4"] .recFishTotal { font-size: 16px !important; font-weight: 700 !important; }
body[data-theme="4"] .recHi { font-size: 12px !important; }


/* СВЕРКА — блок отгрузки */
body[data-theme="4"] .recShipBlock {
  border: 1.5px solid rgba(200,160,32,0.7) !important;
  border-radius: 14px !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
}


/* ═══ КАРТОЧКИ — усиленный золотой ободок ═══ */
body[data-theme="4"] .cd,
body[data-theme="4"] .it { border: 1.5px solid rgba(200,160,32,0.85) !important; }

body[data-theme="4"] .ship-exp-who-btn.buyer.active { background: #27ae60 !important; border-color: #27ae60 !important; color: #fff !important; opacity: 1 !important; box-shadow: 0 4px 14px rgba(39,174,96,0.45) !important; }
body[data-theme="4"] .ship-exp-who-btn.mine.active { background: #e74c3c !important; border-color: #e74c3c !important; color: #fff !important; opacity: 1 !important; box-shadow: 0 4px 14px rgba(231,76,60,0.45) !important; }

/* ══════════════════════════════════════════
   ДОБОР #m-extra: унификация с #m-add (тема 4)
   ══════════════════════════════════════════ */
body[data-theme="4"] #m-extra .in-date,
body[data-theme="4"] #m-extra #extra-date-wrap,
body[data-theme="4"] #m-extra #extra-due-wrap {
  background: rgba(12,13,16,0.88) !important;
  border: 1px solid rgba(255,211,106,0.14) !important;
  box-shadow: inset 3px 3px 8px rgba(0,0,0,0.4), inset -2px -2px 6px rgba(255,255,255,0.03) !important;
  border-radius: 18px !important;
  padding: 10px 16px !important;
  box-sizing: border-box !important;
}
body[data-theme="4"] #m-extra .in-date input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(243,245,247,0.92) !important;
  border-radius: 0 !important;
  height: 36px !important;
  padding: 0 !important;
}
body[data-theme="4"] #m-extra .in-date-title {
  color: rgba(243,245,247,0.50) !important;
  font-size: 11px !important;
  margin-bottom: 4px !important;
}
body[data-theme="4"] #m-extra #e-comm {
  background: rgba(12,13,16,0.88) !important;
  border: 1px solid rgba(255,211,106,0.14) !important;
  box-shadow: inset 3px 3px 8px rgba(0,0,0,0.4), inset -2px -2px 6px rgba(255,255,255,0.03) !important;
  border-radius: 18px !important;
  height: 54px !important;
  min-height: 54px !important;
  box-sizing: border-box !important;
  padding: 0 16px !important;
  color: rgba(243,245,247,0.92) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  width: 100% !important;
}
body[data-theme="4"] #m-extra #e-comm::placeholder {
  color: rgba(243,245,247,0.40) !important;
}
body[data-theme="4"] #m-extra #e-comm:focus {
  border-color: rgba(255,211,106,0.34) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255,211,106,0.10), inset 3px 3px 8px rgba(0,0,0,0.4) !important;
}

/* ══════════════════════════════════════════
   ДОБОР #m-extra: золотые ободки (тема 4)
   ══════════════════════════════════════════ */
body[data-theme="4"] #m-extra .mc,
body[data-theme="4"] #m-extra .in-field,
body[data-theme="4"] #m-extra input,
body[data-theme="4"] #m-extra textarea,
body[data-theme="4"] #m-extra select,
body[data-theme="4"] #m-extra .br,
body[data-theme="4"] #m-extra .btn-main,
body[data-theme="4"] #m-extra .contr-pick-btn,
body[data-theme="4"] #m-extra .fish-row,
body[data-theme="4"] #m-extra .ship-exp,
body[data-theme="4"] #m-extra [class*="btn"] {
  border: 2px solid rgba(255,211,106,0.55) !important;
}
body[data-theme="4"] #m-extra .mc {
  box-shadow: 0 0 12px rgba(255,211,106,0.15), 0 26px 70px rgba(0,0,0,0.86) !important;
}

/* ── ДОБОР тема 4: .in-date + фикс input внутри ── */
body[data-theme="4"] #m-extra .in-date {
  border: 2px solid rgba(255,211,106,0.55) !important;
}
body[data-theme="4"] #m-extra .in-date input {
  border: none !important;
  box-shadow: none !important;
}

/* ── ДОБОР тема 4: высокая специфичность (2,1,1) для перебития modals.css ── */
body[data-theme="4"] #m-extra #extra-date-wrap,
body[data-theme="4"] #m-extra #extra-due-wrap {
  border: 2px solid rgba(255,211,106,0.55) !important;
  background: rgba(12,13,16,0.88) !important;
  box-shadow: inset 3px 3px 8px rgba(0,0,0,0.4), inset -2px -2px 6px rgba(255,255,255,0.03) !important;
  border-radius: 18px !important;
  padding: 10px 16px !important;
}
body[data-theme="4"] #m-extra #extra-date-wrap input,
body[data-theme="4"] #m-extra #extra-due-wrap input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
body[data-theme="4"] #m-extra #extra-exp-wrap {
  border: 2px solid rgba(255,211,106,0.55) !important;
}
body[data-theme="4"] #m-extra #e-comm {
  border: 2px solid rgba(255,211,106,0.55) !important;
}

/* ── ДОБОР: убрать ободок у inline-кнопок Добавить/Закрыть в строках расходов ── */
body[data-theme="4"] #m-extra .extra-exp-inline-ok,
body[data-theme="4"] #m-extra .extra-exp-inline-cancel,
body[data-theme="4"] #m-extra .ship-exp-inline-btns .br {
  border: none !important;
  box-shadow: none !important;
}
body[data-theme="5"] #m-extra .extra-exp-inline-ok,
body[data-theme="5"] #m-extra .extra-exp-inline-cancel,
body[data-theme="5"] #m-extra .ship-exp-inline-btns .br {
  border: none !important;
  box-shadow: none !important;
}
