/**
 * IIFIN — Глобальные стили (мигрировано из Elementor Custom CSS)
 *
 * Было: Elementor → Настройки сайта → Пользовательский CSS
 * Стили футера вынесены в assets/css/iifin-footer.css
 */

/* ===================== IIFIN — ГЛОБАЛЬНАЯ БАЗА ===================== */

/* Переменные и базовая типографика */
:root{
  --iifin-text:#2a2f45;
  --iifin-muted:#6b7280;
  --iifin-card:#f1ede7;
  --iifin-border:#e5e7eb;
  --iifin-primary:#24A8A6;
  --iifin-primary-600:#0B7E95;
  --iifin-radius:16px;
  --iifin-maxw:1200px;
  --iifin-shadow:0 1px 2px rgba(0,0,0,.03), 0 6px 18px rgba(0,0,0,.06);
}

body{color:var(--iifin-text);}

/* Материальные иконки */
.material-symbols-outlined{
  font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24;
  line-height:1;
  vertical-align:-4px;
  color:currentColor;
}

/* Поля ввода */
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea{
  border-radius:14px !important;
  border:1px solid var(--iifin-border) !important;
  background:#fff !important;
  box-shadow:0 1px 2px rgba(0,0,0,.02) inset !important;
  height:44px;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}
textarea{min-height:110px;}
input:focus, select:focus, textarea:focus{
  outline:none !important;
  border-color:#9fdbe2 !important;
  box-shadow:0 0 0 3px rgba(36,168,166,.12) !important;
}

/* Кнопки */
button, .button, .wp-element-button, .iifin-button, .iifin-btn{
  --_bg:var(--iifin-primary);
  --_bgH:var(--iifin-primary-600);
  --_c:#fff;
  border-radius:12px !important;
  border:none !important;
  background:var(--_bg) !important;
  color:var(--_c) !important;
  padding:12px 18px !important;
  box-shadow:0 10px 24px rgba(36,168,166,.18), 0 2px 4px rgba(0,0,0,.08) !important;
}
button:hover, .button:hover, .wp-element-button:hover, .iifin-button:hover, .iifin-btn:hover{
  background:var(--_bgH) !important;
}

/* Светлые ссылко-кнопки */
.iifin-link, .arrow-link{
  display:inline-flex; align-items:center; gap:6px;
  font-weight:500; text-decoration:none;
  color:#0B7E95; background:#fff;
  border:1px solid #cde6ef; border-radius:999px; padding:6px 10px;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.iifin-link:hover, .arrow-link:hover{border-color:#94d2e5; background:#f8fdff;}

/* Карточки */
.iifin-card, .section-box, .widget-box, .dashboard-page .iifin-block{
  background:var(--iifin-card);
  border:1px solid rgba(0,0,0,.04);
  border-radius:var(--iifin-radius);
  box-shadow:var(--iifin-shadow);
  padding:18px;
}

/* ===================== ДЕСКТОП-САБНАВИГАЦИЯ ===================== */
.iifin-desktop-subnav{ margin:0 auto 12px; }
.iifin-desktop-subnav,
.iifin-desktop-subnav > *{
  display:flex; align-items:center; gap:10px;
  flex-wrap:nowrap !important; min-width:0;
}
.iifin-desktop-subnav{ overflow-x:auto; scrollbar-width:none; }
.iifin-desktop-subnav::-webkit-scrollbar{ display:none; }
.iifin-desktop-subnav a, .iifin-desktop-subnav button{
  flex:0 0 auto; white-space:nowrap; padding:8px 12px;
}
@media (min-width:1400px){
  .iifin-desktop-subnav a, .iifin-desktop-subnav button{ padding:10px 14px; }
}

/* ===================== DASHBOARD ===================== */
@media (min-width:1024px){
  body .dashboard-page .pf-wrap .quick-actions{
    display:none !important; height:0 !important; margin:0 !important; padding:0 !important; overflow:hidden !important;
  }
}

/* ===================== ЦЕЛИ (Goals) ===================== */
.goals-list .goal-item{ padding-right:24px !important; }
.goals-list .goal-item > button,
.goals-list .goal-item > a{
  position:static !important; right:auto !important; top:auto !important;
}

#goals-list{ display:flex; flex-direction:column; gap:20px; align-items:center; }

#goals-list .goal-item{
  width:min(980px,100%);
  margin:0 auto;
  background:#fff; border:1px solid #e7ecef; border-radius:14px; box-shadow:var(--iifin-shadow);
  padding:16px 18px; box-sizing:border-box;
}

#goals-list .goal-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px;
}
#goals-list .goal-title{ font-weight:600; font-size:1.06rem; }

#goals-list .goal-actions{ display:flex; align-items:center; gap:12px; }
#goals-list .goal-actions button{
  width:44px; height:44px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center;
  background:#24A8A6; color:#fff; box-shadow:0 6px 18px rgba(0,0,0,.08);
  font-size:22px; line-height:1; padding:0;
}
#goals-list .goal-actions button:hover{ background:#0B7E95; }

#goals-list .goal-body{ display:flex; flex-direction:column; gap:10px; }

@media (max-width:600px){
  #goals-list .goal-header{ flex-direction:column; align-items:center; }
  #goals-list .goal-actions{ justify-content:center; }
}

/* ===================== ОБЯЗАТЕЛЬСТВА (Obligations) ===================== */
#obligations-list{ display:flex; flex-direction:column; gap:20px; align-items:center; }

#obligations-list .obligation-item{
  width:min(980px,100%);
  margin:0 auto;
  background:#fff; border:1px solid #e7ecef; border-radius:14px; box-shadow:var(--iifin-shadow);
  padding:16px 18px; box-sizing:border-box;
}
#obligations-list .obligation-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px;
}
#obligations-list .obligation-title{ font-weight:600; font-size:1.06rem; }

#obligations-list .obligation-actions{ display:flex; align-items:center; gap:12px; }
#obligations-list .obligation-actions button{
  width:44px; height:44px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center;
  background:#24A8A6; color:#fff; box-shadow:0 6px 18px rgba(0,0,0,.08);
  font-size:22px; line-height:1; padding:0;
}
#obligations-list .obligation-actions button:hover{ background:#0B7E95; }

@media (max-width:600px){
  #obligations-list .obligation-header{ flex-direction:column; align-items:center; }
  #obligations-list .obligation-actions{ justify-content:center; }
}

/* ===================== Таблица доходов/расходов ===================== */
.iifin-table, table.finance-table{
  width:100%; border-collapse:separate; border-spacing:0; background:#fff;
  border:1px solid var(--iifin-border); border-radius:14px; overflow:hidden; box-shadow:var(--iifin-shadow);
}
.iifin-table th, table.finance-table th{
  background:#eef3f5; color:#3b4651; font-weight:600; padding:12px; border-bottom:1px solid var(--iifin-border);
}
.iifin-table td, table.finance-table td{ padding:10px 12px; border-bottom:1px solid #edf0f2; }
.iifin-table tr:last-child td, table.finance-table tr:last-child td{ border-bottom:none; }

/* ===================== Мобильная нижняя панель ===================== */
.app-bottom-nav{
  position:fixed; left:0; right:0; bottom:0; display:flex; justify-content:space-around; gap:6px;
  padding:calc(10px + env(safe-area-inset-bottom)) 8px 10px;
  background:rgba(255,255,255,.86); border-top:1px solid #eee; z-index:9999; backdrop-filter:blur(6px);
  box-shadow:0 -1px 0 rgba(0,0,0,.06);
}
.app-bottom-nav .nav-item{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; font-size:11px;
  color:#111827 !important; text-decoration:none; padding:6px 0;
}
.app-bottom-nav .nav-item.is-active{ color:#24A8A6 !important; }
.app-bottom-nav .nav-item.is-active .material-symbols-outlined{ font-variation-settings:'FILL' 1; }

/* Крупные иконки в кнопках целей/обязательств (десктоп) */
@media (min-width: 1024px){
  .goal-actions button,
  .obligation-actions button{
    width: 44px; height: 44px;
    display:inline-flex; align-items:center; justify-content:center;
    font-size: 22px; line-height: 1; padding: 0;
  }
  .goals-list .goal-item > button,
  .goals-list .goal-item > a{
    width: 44px; height: 44px; font-size: 22px; line-height:1;
  }
}

@media (min-width:1024px){ .app-bottom-nav{ display:none !important; } }

/* Прячем FAB на мобильных и планшетах */
@media (max-width: 1200px){
  #iifin-assistant-fab,
  .iifin-assistant-fab,
  .assistant-fab,
  .iifin-fab{
    display: none !important;
  }
}

/* ===================== /investments/ — mobile overflow fix ===================== */
.investments-page { overflow-x: hidden; }
.investments-page .container{
  max-width: min(1200px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.investments-page .iifin-block{
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.investments-page img,
.investments-page table,
.investments-page pre,
.investments-page code,
.investments-page .report-box,
.investments-page #investment-report-output{
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 768px){
  .investments-page .iifin-grid,
  .investments-page .iifin-grid-c{
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .investments-page .sticky-col{ position: static; top: auto; }
  .investments-page .iifin-block{ padding: 16px; border-radius: 14px; margin: 0; }
  .investments-page .section-title{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
}

@media (max-width: 480px){
  html, body{ width: 100%; }
}

/* Страница с нижней панелью */
body.has-appnav {
  padding-bottom: calc(var(--appnav-h, 64px) + env(safe-area-inset-bottom, 0px));
}

.app-bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--vv-offset, 0px);
  background: rgba(255,255,255,.86);
  border-top: 1px solid #eee;
  backdrop-filter: blur(6px);
  z-index: 9999;
}

@media (min-width:1024px){
  .app-bottom-nav { display:none !important; }
}

/* ===================== Калькуляторы: фикс date на iOS ===================== */
.iifin-calcs .iifin-row .iifin-field{
  min-width:0;
}

.iifin-calcs input[type="date"],
.iifin-deposit input[type="date"]{
  -webkit-appearance:none;
  appearance:none;
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}

/* ===================== WooCommerce Blocks checkout ===================== */
.wc-block-checkout__create-account,
.wc-block-checkout__create-account * {
  display: none !important;
}

.wc-block-components-checkbox.wc-block-checkout__create-account {
  display: none !important;
}
