/* ============================================================
   Elegant / CRM Panel — styles.css
   Объединено: dashboard (index.html) + auth (login.html)
   Темы: light (по умолчанию) / dark через <html data-theme="dark">
   ============================================================ */

/* ============================================================
   1. ПЕРЕМЕННЫЕ ТЕМ
   ============================================================ */
:root,
:root[data-theme="light"]{
  /* базовые токены */
  --bg:#f5f7fb;
  --sidebar:#111a2e;
  --sidebar-2:#18233b;
  --text:#18243d;
  --muted:#8290a8;
  --line:#e6ebf3;
  --blue:#477ff2;
  --green:#20b779;
  --red:#f35d62;
  --purple:#6755ef;
  --cyan:#4da4ff;
  --shadow:0 8px 30px rgba(28,45,75,.06);
  --radius:16px;

  /* фон страницы */
  --page-bg:#eef2f9;
  --page-gradients:
    radial-gradient(700px 600px at 12% 8%,   #6f9dff, transparent 62%),
    radial-gradient(650px 650px at 88% 18%,  #b48cff, transparent 62%),
    radial-gradient(900px 700px at 45% 105%, #5fd8b4, transparent 62%),
    radial-gradient(600px 500px at 95% 95%,  #ff9dc0, transparent 62%),
    radial-gradient(500px 500px at 55% 45%,  #7fc9ff, transparent 65%);

  /* стекло */
  --glass-blur:none;
  --card-bg:#ffffff;
  --card-border:var(--line);

  /* сайдбар */
  --sidebar-bg:linear-gradient(180deg, rgba(17,26,46,.62), rgba(15,23,41,.55));
  --sidebar-blur:blur(26px) saturate(180%);
  --sidebar-border:rgba(255,255,255,.10);
  --sidebar-shadow:12px 0 50px rgba(10,18,35,.18);

  /* мягкие кнопки (дата, иконки, мобильное меню, тема, выход) */
  --btn-soft-bg:#ffffff;
  --btn-soft-border:var(--line);
  --btn-soft-color:#33415b;
  --btn-soft-hover:#f8faff;
  --btn-soft-blur:none;

  /* поля ввода */
  --input-bg:#ffffff;
  --input-hover-border:#d8e1f0;
  --input-placeholder:#b3bfd2;
  --checkbox-border:#cfd8e6;

  /* иконки статистики */
  --ic-green-bg:#e3f7ef;  --ic-green:#20b779;
  --ic-red-bg:#ffe9ea;    --ic-red:#f35d62;
  --ic-purple-bg:#ece9ff; --ic-purple:#6755ef;
  --ic-blue-bg:#e7f2ff;   --ic-blue:#4da4ff;

  /* пилюли статусов */
  --pill-green-bg:#e6f8f0; --pill-green:#159663;
  --pill-red-bg:#ffe9ea;   --pill-red:#d8474e;
  --pill-blue-bg:#e8f1ff;  --pill-blue:#3d70d7;

  /* прочее */
  --progress-bg:#e9edf4;
  --avatar-bg:#e7edf7;
  --avatar-color:#44526d;
  --status-bg:#e6f8f0;
  --status-color:#159663;

  --field-label:#4a5670;
  --icon-muted:#9aa8bf;
  --notification-border:#ffffff;
}

:root[data-theme="dark"]{
  --bg:#0b1220;
  --sidebar:#0d1524;
  --sidebar-2:#152039;
  --text:#eaf0fb;
  --muted:#8ea0bd;
  --line:rgba(255,255,255,.10);
  --blue:#5b8cf6;
  --green:#2cc98a;
  --red:#ff6b70;
  --purple:#8778ff;
  --cyan:#5fb2ff;
  --shadow:0 12px 40px rgba(6,12,26,.45);
  --radius:16px;

  --page-bg:#0b1220;
  --page-gradients:
    radial-gradient(700px 600px at 12% 8%,   rgba(71,127,242,.35), transparent 62%),
    radial-gradient(650px 650px at 88% 18%,  rgba(103,85,239,.30), transparent 62%),
    radial-gradient(900px 700px at 45% 105%, rgba(45,183,121,.20), transparent 62%),
    radial-gradient(600px 500px at 95% 95%,  rgba(255,157,192,.14), transparent 62%),
    radial-gradient(500px 500px at 55% 45%,  rgba(127,201,255,.15), transparent 65%);

  --glass-blur:blur(20px) saturate(160%);
  --card-bg:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  --card-border:rgba(255,255,255,.10);

  --sidebar-bg:linear-gradient(180deg, rgba(17,26,46,.78), rgba(15,23,41,.72));
  --sidebar-blur:blur(26px) saturate(180%);
  --sidebar-border:rgba(255,255,255,.10);
  --sidebar-shadow:12px 0 50px rgba(3,7,18,.45);

  --btn-soft-bg:rgba(255,255,255,.06);
  --btn-soft-border:rgba(255,255,255,.10);
  --btn-soft-color:#eaf0fb;
  --btn-soft-hover:rgba(255,255,255,.10);
  --btn-soft-blur:blur(14px);

  --input-bg:rgba(255,255,255,.05);
  --input-hover-border:rgba(255,255,255,.18);
  --input-placeholder:#6d7a92;
  --checkbox-border:rgba(255,255,255,.22);

  --ic-green-bg:rgba(32,183,121,.18);  --ic-green:#5ddba7;
  --ic-red-bg:rgba(243,93,98,.18);     --ic-red:#ff8890;
  --ic-purple-bg:rgba(103,85,239,.22); --ic-purple:#a99bff;
  --ic-blue-bg:rgba(77,164,255,.20);   --ic-blue:#7fc0ff;

  --pill-green-bg:rgba(32,183,121,.18); --pill-green:#5ddba7;
  --pill-red-bg:rgba(243,93,98,.18);    --pill-red:#ff8890;
  --pill-blue-bg:rgba(77,164,255,.18);  --pill-blue:#7fc0ff;

  --progress-bg:rgba(255,255,255,.08);
  --avatar-bg:rgba(255,255,255,.08);
  --avatar-color:#c8d4ea;
  --status-bg:rgba(32,183,121,.18);
  --status-color:#5ddba7;

  --field-label:#c9d2e2;
  --icon-muted:#8798b5;
  --notification-border:#0b1220;
}

/* ============================================================
   2. БАЗА
   ============================================================ */
*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background-color:var(--page-bg);
  background-image:var(--page-gradients);
  background-attachment:fixed;
  background-repeat:no-repeat;
  transition:background-color .25s ease, color .25s ease;
}

button,input{font:inherit}

/* ============================================================
   3. ОБЩИЕ КОМПОНЕНТЫ
   ============================================================ */

/* текстовые ссылки */
.link{
  color:var(--blue);
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  border:0;
  background:none;
  cursor:pointer;
  padding:5;
}
.link:hover{text-decoration:underline}

/* бренд */
.brand{display:flex;align-items:center;gap:12px}
.brand-mark{
  width:38px;height:38px;border-radius:11px;
  background:linear-gradient(135deg,#fff,#9fb8e9);
  position:relative;flex-shrink:0;
}
.brand-mark:after{
  content:"";
  position:absolute;
  width:18px;height:18px;
  background:var(--sidebar);
  border-radius:5px;
  left:10px;top:10px;
}
.brand strong{display:block;font-size:18px;letter-spacing:-.4px;color:#fff}
.brand span{display:block;color:#a4b3cd;font-size:12px;margin-top:2px}

/* ============================================================
   4. DASHBOARD (index.html)
   ============================================================ */
.app{
  display:flex;
  min-height:100vh;
  color:var(--text);
}

/* ---------- Стеклянный сайдбар ---------- */
.sidebar{
  width:255px;
  padding:28px 13px 20px;
  position:fixed;left:0;top:0;bottom:0;z-index:20;
  display:flex;flex-direction:column;
  background:var(--sidebar-bg);
  -webkit-backdrop-filter:var(--sidebar-blur);
          backdrop-filter:var(--sidebar-blur);
  border-right:1px solid var(--sidebar-border);
  box-shadow:var(--sidebar-shadow);
  transition:background .25s ease, transform .25s ease;
}
.sidebar>*{position:relative;z-index:1}
.sidebar .brand{padding:0 13px 30px}

.nav{display:flex;flex-direction:column;gap:7px}
.nav-btn{
  border:0;
  background:transparent;
  color:#d0d8e5;
  border-radius:11px;
  padding:13px 14px;
  display:flex;
  align-items:center;
  gap:13px;
  cursor:pointer;
  text-align:left;
  font-size:14px;
  text-decoration:none;   /* <-- добавь это */
  transition:.2s;
}
.nav-btn:hover{background:rgba(255,255,255,.10);color:#fff}
.nav-btn.active{
  background:linear-gradient(135deg,#3564c6,#3157a6);
  color:#fff;
  box-shadow:0 8px 18px rgba(47,91,178,.30);
}
.nav-icon{width:22px;text-align:center;font-size:18px}
.sidebar-bottom{margin-top:auto}

/* ---------- Основная область ---------- */
.main{
  margin-left:0;
  width:100%;
  padding:30px 30px 42px 285px;
  min-height:100vh;
}

/* Отступы между крупными секциями в .main */
.main > #masters,
.main > .bottom-grid,
.main > .schedule-block{
  margin-bottom:12px;
}

/* или универсально — все прямые «секционные» блоки в main */
.main > .section-card,
.main > .bottom-grid,
.main > #masters{
  margin-bottom:12px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:25px;
}
.title h1{font-size:28px;line-height:1.15;margin:0 0 6px;letter-spacing:-.8px}
.title p{margin:0;color:var(--muted);font-size:14px}
.top-actions{display:flex;align-items:center;gap:12px}

/* ---------- Мягкие кнопки: дата / иконка / тема / меню / выход ---------- */
.date-btn,
.icon-btn,
.mobile-menu,
.theme-btn,
.logout-btn{
  background:var(--btn-soft-bg);
  border:1px solid var(--btn-soft-border);
  color:var(--btn-soft-color);
  -webkit-backdrop-filter:var(--btn-soft-blur);
          backdrop-filter:var(--btn-soft-blur);
  transition:background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.date-btn:hover,
.icon-btn:hover,
.mobile-menu:hover,
.theme-btn:hover{background:var(--btn-soft-hover)}

.date-btn{
  border-radius:10px;
  padding:11px 14px;
  cursor:pointer;
}

.icon-btn,
.theme-btn{
  width:42px;height:42px;
  border-radius:11px;
  cursor:pointer;
  display:grid;place-items:center;
  position:relative;
}
.icon-btn .badge,
.theme-btn svg{width:18px;height:18px}

.mobile-menu{
  width:42px;height:42px;
  border-radius:11px;
  cursor:pointer;
  display:none;
  place-items:center;
}

/* переключатель темы */
.theme-btn .ico-sun{display:none}
:root[data-theme="dark"] .theme-btn .ico-moon{display:none}
:root[data-theme="dark"] .theme-btn .ico-sun {display:block}

.notification-dot{
  position:absolute;
  width:7px;height:7px;
  background:#ef5259;
  border:2px solid var(--notification-border);
  border-radius:50%;
  right:8px;top:7px;
}

.avatar{
  width:42px;height:42px;border-radius:50%;
  background:linear-gradient(135deg,#d8e0ee,#8495b1);
  display:grid;place-items:center;
  color:#fff;font-weight:700;
}

/* кнопка «Выйти» */
.logout-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:42px;
  padding:0 16px;
  border-radius:11px;
  font-size:13.5px;
  font-weight:600;
  letter-spacing:.1px;
  cursor:pointer;
  box-shadow:var(--shadow);
}
.logout-btn svg{
  width:16px;height:16px;
  flex-shrink:0;
  transition:transform .2s;
}
.logout-btn:hover{
  background:rgba(243,93,98,.16);
  border-color:rgba(243,93,98,.38);
  color:#ff8890;
}
.logout-btn:hover svg{transform:translateX(2px)}
.logout-btn:active{transform:translateY(1px);box-shadow:none}
.logout-btn:focus-visible{
  outline:none;
  border-color:var(--red);
  box-shadow:0 0 0 4px rgba(243,93,98,.15);
}

/* ---------- Страницы ---------- */
.page{display:none}
.page.active{display:block}

/* ---------- Карточки ---------- */
.cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:20px;
}
.card{
  background:var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  -webkit-backdrop-filter:var(--glass-blur);
          backdrop-filter:var(--glass-blur);
  transition:background .25s ease, border-color .25s ease;
}

/* ---------- Плитка статистики ---------- */
.stat{padding:20px}
.stat-top{display:flex;align-items:center;justify-content:space-between}
.stat-label{font-size:13px;font-weight:600}
.stat-value{font-size:27px;font-weight:750;margin:14px 0 6px;letter-spacing:-.5px}
.stat-change{font-size:12px;color:var(--muted)}
.up{color:var(--green);font-weight:700}
.down{color:var(--red);font-weight:700}

.stat-icon{
  width:40px;height:40px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  font-size:18px;
  flex-shrink:0;
}
.stat-icon.green {background:var(--ic-green-bg); color:var(--ic-green)}
.stat-icon.red   {background:var(--ic-red-bg);   color:var(--ic-red)}
.stat-icon.purple{background:var(--ic-purple-bg);color:var(--ic-purple)}
.stat-icon.blue  {background:var(--ic-blue-bg);  color:var(--ic-blue)}

.progress{
  height:7px;
  background:var(--progress-bg);
  border-radius:99px;
  overflow:hidden;
  margin:13px 0 7px;
}
.progress span{
  height:100%;
  display:block;
  border-radius:inherit;
  background:var(--green);
}

/* ---------- Графики ---------- */
.charts{
  display:grid;
  grid-template-columns:1.08fr .92fr;
  gap:16px;
  margin-bottom:16px;
}
.chart-card{padding:20px;height:350px}
.card-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:12px;
}
.card-head h3{font-size:16px;margin:0}
.card-head .link{font-size:11px;font-weight:500;color:var(--blue)}
.legend{display:flex;gap:15px;color:var(--muted);font-size:11px}
.legend i{
  display:inline-block;
  width:8px;height:8px;
  border-radius:2px;
  margin-right:5px;
}
canvas{width:100%!important;height:275px!important}

/* ---------- Нижний блок: бюджет + мастера ---------- */
.bottom-grid{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.masters-card{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.masters{
  flex:1;
  overflow-y:auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.budget-card,.masters-card{padding:20px;min-height:300px}

.budget-content{
  display:grid;
  grid-template-columns:190px 1fr;
  gap:20px;
  align-items:center;
}
.donut-wrap{height:210px;position:relative}
.donut-center{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  pointer-events:none;
}
.donut-center strong{font-size:20px}
.donut-center span{font-size:11px;color:var(--muted);margin-top:3px}
.budget-list{display:flex;flex-direction:column;gap:15px}
.budget-row{
  display:flex;justify-content:space-between;gap:15px;
  padding-bottom:13px;
  border-bottom:1px solid var(--line);
  font-size:12px;
}
.budget-row:last-child{border:0}
.budget-label{color:var(--muted)}
.budget-value{font-weight:700}

.master{
  display:flex;align-items:center;gap:11px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.master:last-child{border:0}
.master-avatar{
  width:38px;height:38px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--avatar-bg);
  color:var(--avatar-color);
  font-size:12px;font-weight:700;
}
.master-info{flex:1}
.master-name{font-size:13px;font-weight:700}
.master-role{font-size:11px;color:var(--muted);margin-top:2px}
.master-time{font-size:11px;color:var(--muted);margin-right:10px}
.status{
  font-size:10px;
  color:var(--status-color);
  background:var(--status-bg);
  padding:6px 9px;
  border-radius:7px;
  font-weight:700;
}

/* ---------- Секции с таблицами ---------- */
.section-card{padding:22px}
.section-card h2{margin:0 0 5px}
.section-card p{color:var(--muted);margin-top:0}
.table-wrap{overflow:auto;margin-top:20px}
.table{width:100%;border-collapse:collapse;font-size:13px}
.table th,
.table td{
  text-align:left;
  padding:13px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.table th{color:var(--muted);font-weight:600;font-size:11px}

.pill{
  display:inline-block;
  padding:5px 9px;
  border-radius:7px;
  font-size:10px;
  font-weight:700;
}
.pill.green{background:var(--pill-green-bg);color:var(--pill-green)}
.pill.red  {background:var(--pill-red-bg);  color:var(--pill-red)}
.pill.blue {background:var(--pill-blue-bg); color:var(--pill-blue)}

/* ============================================================
   5. AUTH (login.html)
   ============================================================ */
.auth{display:flex;min-height:100vh;background:var(--bg)}

/* ---------- Левая панель ---------- */
.auth-aside{
  width:46%;max-width:600px;flex-shrink:0;
  background:linear-gradient(180deg,var(--sidebar),#0f1729);
  color:#fff;
  padding:44px 46px;
  display:flex;flex-direction:column;
  position:relative;overflow:hidden;
}
.auth-aside:before,
.auth-aside:after{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}
.auth-aside:before{
  width:520px;height:520px;right:-200px;top:-180px;
  background:radial-gradient(circle,rgba(71,127,242,.30),transparent 65%);
}
.auth-aside:after{
  width:460px;height:460px;left:-190px;bottom:-190px;
  background:radial-gradient(circle,rgba(103,85,239,.28),transparent 65%);
}
.auth-aside>*{position:relative;z-index:1}

.auth-aside h2{
  font-size:30px;line-height:1.25;letter-spacing:-.8px;
  margin:56px 0 14px;
}
.auth-aside .lead{
  color:#a9b6cc;font-size:14px;line-height:1.65;
  margin:0 0 32px;max-width:380px;
}

.auth-features{
  list-style:none;padding:0;margin:0;
  display:flex;flex-direction:column;gap:14px;
}
.auth-features li{
  display:flex;align-items:center;gap:11px;
  font-size:13.5px;color:#d5dce8;
}
.tick{
  width:22px;height:22px;border-radius:7px;flex-shrink:0;
  background:rgba(71,127,242,.22);color:#8fb3ff;
  display:grid;place-items:center;
  font-size:11px;font-weight:700;
}
.aside-foot{
  margin-top:auto;
  color:#7d8ba5;font-size:12px;line-height:1.6;
  padding-top:32px;
}

/* ---------- Правая часть ---------- */
.auth-main{flex:1;display:grid;place-items:center;padding:44px 26px}
.auth-card{width:100%;max-width:404px}
.auth-card h1{font-size:26px;letter-spacing:-.7px;margin:0 0 8px}
.auth-sub{color:var(--muted);font-size:13.5px;margin:0 0 28px}

.auth-mobile-brand{display:none;align-items:center;gap:12px;margin-bottom:26px}
.auth-mobile-brand .brand-mark{background:linear-gradient(135deg,var(--sidebar-2),#0f1729)}
.auth-mobile-brand strong{font-size:16px;color:var(--text);letter-spacing:-.4px}

/* ---------- Поля ---------- */
.field{display:flex;flex-direction:column;gap:7px;margin-bottom:16px}
.field label{font-size:12px;font-weight:600;color:var(--field-label)}
.field-row .field .input {
  min-width: 0;    /* разрешаем сжатие без вылезания */
}

/* опционально — задать минимальную ширину именно дому и квартире */
.field-row .field:nth-child(3) .input,
.field-row .field:nth-child(4) .input {
  min-width: 70px;
}
.input-wrap{position:relative;display:flex;align-items:center}
.input-icon{position:absolute;left:14px;color:var(--icon-muted);pointer-events:none}
.input {
  width: 100%;
  box-sizing: border-box;           /* ← обязательно */
  font-size: 14px;
  color: var(--text);
  padding: 13px 14px;               /* ← базовый паддинг без иконок */
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: .18s;
}
.input::placeholder{color:var(--input-placeholder)}
.input:hover{border-color:var(--input-hover-border)}
.input:focus{border-color:var(--blue);box-shadow:0 0 0 4px rgba(71,127,242,.13)}

select.input{
  appearance:none;-webkit-appearance:none;
  padding-right:38px;
  background-image:
    linear-gradient(45deg,transparent 50%,var(--icon-muted) 50%),
    linear-gradient(135deg,var(--icon-muted) 50%,transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
  cursor:pointer;
}
select.input option{
  background:var(--card-bg);
  color:var(--text);
}

.toggle-pass{
  position:absolute;right:6px;
  width:34px;height:34px;
  border:0;background:transparent;
  color:var(--icon-muted);
  border-radius:9px;
  cursor:pointer;
  display:grid;place-items:center;
  transition:.18s;
}
.toggle-pass:hover{background:var(--btn-soft-hover);color:var(--btn-soft-color)}
.toggle-pass .eye-off{display:none}
.toggle-pass.show .eye-on{display:none}
.toggle-pass.show .eye-off{display:block}

/* ---------- «Запомнить / забыли» ---------- */
.form-row{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  margin:2px 0 20px;
}
.checkbox{
  display:flex;align-items:center;gap:9px;
  font-size:13px;color:var(--field-label);
  cursor:pointer;user-select:none;
}
.checkbox input{
  appearance:none;-webkit-appearance:none;
  flex-shrink:0;
  width:18px;height:18px;
  border:1px solid var(--checkbox-border);
  border-radius:6px;
  background:var(--input-bg);
  cursor:pointer;
  position:relative;
  transition:.15s;
  margin:0;
}
.checkbox input:checked{background:var(--blue);border-color:var(--blue)}
.checkbox input:checked::after{
  content:"";
  position:absolute;
  left:6px;top:2.5px;
  width:4px;height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}

/* ---------- Кнопки ---------- */
.btn-primary{
  width:100%;
  border:0;
  border-radius:12px;
  padding:14px;
  background:linear-gradient(135deg,#477ff2,#3564c6);
  color:#fff;
  font-size:14px;
  font-weight:650;
  cursor:pointer;
  letter-spacing:.2px;
  box-shadow:0 10px 22px rgba(53,100,198,.28);
  transition:.2s;
}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(53,100,198,.34)}
.btn-primary:active{transform:translateY(0)}

.divider{
  display:flex;align-items:center;gap:14px;
  margin:22px 0;
  color:var(--muted);
  font-size:10.5px;
  text-transform:uppercase;
  letter-spacing:.7px;
}
.divider:before,
.divider:after{content:"";height:1px;background:var(--line);flex:1}

.btn-ghost{
  width:100%;
  display:flex;align-items:center;justify-content:center;gap:10px;
  padding:13px;
  border:1px solid var(--line);
  background:var(--input-bg);
  border-radius:12px;
  font-size:13.5px;
  font-weight:600;
  color:var(--btn-soft-color);
  cursor:pointer;
  transition:.2s;
}
.btn-ghost:hover{background:var(--btn-soft-hover);border-color:var(--input-hover-border)}

.form-error{
  display:none;
  align-items:center;gap:8px;
  background:#ffe9ea;
  color:#d8474e;
  border-radius:10px;
  padding:10px 13px;
  font-size:12.5px;
  font-weight:600;
  margin:0 0 16px;
}
.form-error.show{display:flex}

.auth-foot{text-align:center;font-size:13px;color:var(--muted);margin:24px 0 0}

/* ============================================================
   6. АДАПТИВ
   ============================================================ */

/* планшет — dashboard */
@media(max-width:1100px){
  .cards{grid-template-columns:repeat(2,1fr)}
  .charts,
  .bottom-grid{grid-template-columns:1fr}
}

/* планшет — login */
@media(max-width:940px){
  .auth-aside{display:none}
  .auth-mobile-brand{display:flex}
  .auth-main{padding:32px 18px}
}

/* мобильный — оба */
@media(max-width:760px){
  .sidebar{transform:translateX(-100%);width:245px}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0;width:100%;padding:20px 15px 30px}
  .mobile-menu{display:grid}
  .topbar{align-items:flex-start}
  .title h1{font-size:23px}
  .top-actions .date-btn{display:none}
  .cards{grid-template-columns:1fr}
  .budget-content{grid-template-columns:1fr}
  .donut-wrap{height:190px}
}

/* узкий мобильный — login */
@media(max-width:400px){
  .auth-card h1{font-size:22px}
  .form-row{flex-direction:column;align-items:flex-start;gap:10px}
}

/* ---------- Кнопка «Удалить» ---------- */
.btn-danger{
  display:inline-flex;align-items:center;gap:8px;
  height:42px;padding:0 16px;
  border:1px solid rgba(243,93,98,.35);
  background:rgba(243,93,98,.12);
  color:#d8474e;
  border-radius:11px;
  font-size:13.5px;font-weight:600;
  cursor:pointer;transition:.2s;
}
.btn-danger:hover:not(:disabled){
  background:rgba(243,93,98,.20);
  border-color:rgba(243,93,98,.55);
}
.btn-danger:disabled{
  opacity:.45;cursor:not-allowed;
}
:root[data-theme="dark"] .btn-danger{
  color:#ff8890;
  background:rgba(243,93,98,.16);
  border-color:rgba(243,93,98,.38);
}

/* компактный вариант .btn-primary в top-actions */
.top-actions .btn-primary{
  width:auto;
  padding:0 18px;
  height:42px;
  font-size:13.5px;
}

/* ---------- Модальное окно ---------- */
.modal-backdrop{
  position:fixed;inset:0;z-index:100;
  background:rgba(9,15,28,.55);
  -webkit-backdrop-filter:blur(6px);
          backdrop-filter:blur(6px);
  display:none;
  align-items:center;justify-content:center;
  padding:20px;
}
.modal-backdrop.open{display:flex}

.modal{
  width:100%;max-width:460px;
  background:var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:var(--radius);
  box-shadow:0 30px 80px rgba(6,12,26,.45);
  -webkit-backdrop-filter:var(--glass-blur);
          backdrop-filter:var(--glass-blur);
  overflow:hidden;
  animation:modalIn .18s ease;
}
@keyframes modalIn{
  from{opacity:0;transform:translateY(8px) scale(.98)}
  to  {opacity:1;transform:none}
}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 22px;
  border-bottom:1px solid var(--line);
}
.modal-head h3{margin:0;font-size:17px}
.modal-close{
  width:32px;height:32px;
  border:0;background:transparent;
  color:var(--muted);
  font-size:22px;line-height:1;
  border-radius:8px;cursor:pointer;
  transition:.15s;
}
.modal-close:hover{background:var(--btn-soft-hover);color:var(--text)}
.modal-body{padding:20px 22px 22px}

/* ---------- Чекбоксы в таблице ---------- */
.table input[type="checkbox"]{
  appearance:none;-webkit-appearance:none;
  width:16px;height:16px;
  border:1px solid var(--checkbox-border);
  border-radius:5px;
  background:var(--input-bg);
  cursor:pointer;position:relative;
  transition:.15s;margin:0;
}
.table input[type="checkbox"]:checked{
  background:var(--blue);border-color:var(--blue);
}
.table input[type="checkbox"]:checked::after{
  content:"";
  position:absolute;left:5px;top:1.5px;
  width:4px;height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}

/* ---------- Кнопка «Удалить» ---------- */
.btn-danger{
  display:inline-flex;align-items:center;gap:8px;
  height:42px;padding:0 16px;
  border:1px solid rgba(243,93,98,.35);
  background:rgba(243,93,98,.12);
  color:#d8474e;
  border-radius:11px;
  font-size:13.5px;font-weight:600;
  cursor:pointer;transition:.2s;
}
.btn-danger:hover:not(:disabled){
  background:rgba(243,93,98,.20);
  border-color:rgba(243,93,98,.55);
}
.btn-danger:disabled{
  opacity:.45;cursor:not-allowed;
}
:root[data-theme="dark"] .btn-danger{
  color:#ff8890;
  background:rgba(243,93,98,.16);
  border-color:rgba(243,93,98,.38);
}

/* компактный вариант .btn-primary в top-actions */
.top-actions .btn-primary{
  width:auto;
  padding:0 18px;
  height:42px;
  font-size:13.5px;
}

/* ---------- Модальное окно ---------- */
.modal-backdrop{
  position:fixed;inset:0;z-index:100;
  background:rgba(9,15,28,.55);
  -webkit-backdrop-filter:blur(6px);
          backdrop-filter:blur(6px);
  display:none;
  align-items:center;justify-content:center;
  padding:20px;
}
.modal-backdrop.open{display:flex}

.modal{
  width:100%;max-width:460px;
  background:var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:var(--radius);
  box-shadow:0 30px 80px rgba(6,12,26,.45);
  -webkit-backdrop-filter:var(--glass-blur);
          backdrop-filter:var(--glass-blur);
  overflow:hidden;
  animation:modalIn .18s ease;
}
@keyframes modalIn{
  from{opacity:0;transform:translateY(8px) scale(.98)}
  to  {opacity:1;transform:none}
}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 22px;
  border-bottom:1px solid var(--line);
}
.modal-head h3{margin:0;font-size:17px}
.modal-close{
  width:32px;height:32px;
  border:0;background:transparent;
  color:var(--muted);
  font-size:22px;line-height:1;
  border-radius:8px;cursor:pointer;
  transition:.15s;
}
.modal-close:hover{background:var(--btn-soft-hover);color:var(--text)}
.modal-body{padding:20px 22px 22px}

/* ---------- Чекбоксы в таблице ---------- */
.table input[type="checkbox"]{
  appearance:none;-webkit-appearance:none;
  width:16px;height:16px;
  border:1px solid var(--checkbox-border);
  border-radius:5px;
  background:var(--input-bg);
  cursor:pointer;position:relative;
  transition:.15s;margin:0;
}
.table input[type="checkbox"]:checked{
  background:var(--blue);border-color:var(--blue);
}
.table input[type="checkbox"]:checked::after{
  content:"";
  position:absolute;left:5px;top:1.5px;
  width:4px;height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}

.modal-section{
  margin:18px 0 10px;
  font-size:13px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.6px;
  font-weight:600;
}
.modal-section:first-child{margin-top:0}
.field-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
textarea.input{
  resize:vertical;
  min-height:60px;
  padding:12px 14px;
}

.modal-backdrop{
  position:fixed;inset:0;z-index:100;
  background:rgba(9,15,28,.55);
  -webkit-backdrop-filter:blur(6px);
          backdrop-filter:blur(6px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  overflow-y:auto;                 /* ← скролл, если модалка выше экрана */
}
.modal-backdrop.open{display:flex}

.modal{
  width:100%;
  max-width:460px;
  max-height:calc(100vh - 40px);   /* ← не выше экрана минус padding */
  display:flex;
  flex-direction:column;           /* ← шапка + тело */
  background:var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:var(--radius);
  box-shadow:0 30px 80px rgba(6,12,26,.45);
  -webkit-backdrop-filter:var(--glass-blur);
          backdrop-filter:var(--glass-blur);
  overflow:hidden;                 /* скругления не рвутся */
  animation:modalIn .18s ease;
}

.modal-head{
  flex-shrink:0;                   /* шапка не сжимается */
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 22px;
  border-bottom:1px solid var(--line);
}

.modal-body{
  flex:1 1 auto;
  min-height:0;                    /* без этого flex-скролл не работает */
  overflow-y:auto;                 /* ← скролл именно тут */
  padding:20px 22px 22px;
}

/* Отступы между крупными секциями в main */
.main > .charts-block,
.main > .debts-block,
.main > .transactions-block,
.main > .schedule-block,
.main > .bottom-grid,
.main > #masters,
.main > .requests-block{
  margin-bottom:12px;
}

.chart-card canvas{
  width: 100% !important;
  height: 95% !important;
  display: block;
}