*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:#0a0e1a;
  color:#e0e6ed;
}
.container{
  max-width:820px;
  margin:40px auto;
  padding:0 18px;
}
.card{
  background:#111827;
  border:1px solid #1e2a3a;
  border-radius:16px;
  padding:26px;
  box-shadow:0 10px 30px rgba(0,0,0,.3);
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
}
.logo{
  width:44px;height:44px;
  border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:#00e68a;
  color:#0a0e1a;
  font-weight:700;
}
.title{font-weight:700;color:#fff}
.subtitle{font-size:13px;color:#6b7b8d;margin-top:2px}
.muted{color:#6b7b8d;margin:0 0 14px}
h1{margin:12px 0 8px;font-size:22px;color:#fff}

/* ===== Вкладки ===== */
.tabs{
  display:flex;
  gap:4px;
  margin-bottom:18px;
  border-bottom:2px solid #1e2a3a;
  padding-bottom:0;
}
.tab{
  padding:10px 20px;
  border:none;
  background:none;
  font-size:15px;
  font-weight:600;
  color:#6b7b8d;
  cursor:pointer;
  border-bottom:2px solid transparent;
  margin-bottom:-2px;
  transition:color .15s, border-color .15s;
}
.tab:hover{color:#e0e6ed}
.tab.active{
  color:#00e68a;
  border-bottom-color:#00e68a;
}
.tab-content{display:none}
.tab-content.active{display:block}

/* ===== Формы ===== */
.form{margin-top:12px}
.label{display:block;font-weight:600;margin:12px 0 6px;color:#c0c8d4}
.input{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid #2a3548;
  font-size:15px;
  background:#0d1525;
  color:#e0e6ed;
}
.input:focus{
  outline:none;
  border-color:#00e68a;
  box-shadow:0 0 0 4px rgba(0,230,138,.15);
}
.btn{
  margin-top:16px;
  width:100%;
  padding:12px 14px;
  border:0;
  border-radius:12px;
  background:#00e68a;
  color:#0a0e1a;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s;
}
.btn:hover{background:#00cc7a}
.btn:disabled{background:#1a4d3a;color:#4a6a5a;cursor:not-allowed}
.btn-cancel{
  background:#f87171;
  color:#fff;
  margin-top:8px;
}
.btn-cancel:hover{background:#ef4444}
.btn-rates{
  width:100%;
  padding:10px 14px;
  border:1px solid #1a4d3a;
  border-radius:12px;
  background:#0d2818;
  color:#00e68a;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s, border-color .15s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.btn-rates:hover{background:#14382a;border-color:#00e68a}
.btn-rates:disabled{color:#4a6a5a;cursor:not-allowed}
.rates-icon{font-size:16px}
.rates-info{
  margin-top:8px;
  font-size:13px;
  color:#8896a6;
}
.warn-box{
  background:#4a1a00;
  border:2px solid #ff6b2b;
  color:#ffb088;
  padding:14px 16px;
  border-radius:12px;
  margin:12px 0;
  font-size:14px;
  line-height:1.5;
}
.warn-box strong{
  color:#ff6b2b;
  font-size:15px;
}
.warn-names{
  margin-top:6px;
  color:#fff;
  font-weight:600;
  font-size:14px;
}
.warn-note{
  margin-top:4px;
  color:#ffb088;
  font-size:13px;
  font-style:italic;
}
.alert{
  background:#3b1419;
  border:1px solid #6b2028;
  color:#f87171;
  padding:10px 12px;
  border-radius:12px;
  margin:10px 0 12px;
}
.err-msg{font-weight:600}
.err-toggle{
  margin-top:8px;
  background:transparent;
  border:1px solid #6b2028;
  color:#f87171;
  border-radius:8px;
  padding:4px 10px;
  font-size:12px;
  cursor:pointer;
}
.err-toggle:hover{background:#4a1a20}
.err-details{
  margin:8px 0 0;
  padding:8px 10px;
  max-height:240px;
  overflow:auto;
  background:#1f0b0e;
  border-radius:8px;
  color:#fca5a5;
  font-size:11px;
  line-height:1.4;
  white-space:pre-wrap;
  word-break:break-word;
}
.field-error{margin:6px 0 0;font-size:13px}
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px 16px;
}
.field{grid-column:span 1}
.field.full{grid-column:span 2}
.radio-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:6px}
.radio{display:flex;align-items:center;gap:8px;font-weight:500;color:#c0c8d4}
.check{display:flex;align-items:center;gap:8px;margin-top:10px;color:#8896a6}

/* ===== Поле с кнопкой ===== */
.input-with-btn{
  display:flex;
  gap:8px;
  align-items:center;
}
.input-with-btn .input{
  flex:1;
  min-width:0;
}
.btn-inline{
  padding:10px 14px;
  border:1px solid #1a4d3a;
  border-radius:12px;
  background:#0d2818;
  color:#00e68a;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
  transition:background .15s, border-color .15s;
}
.btn-inline:hover{background:#14382a;border-color:#00e68a}

/* Скрытый <input type="date"> под кнопкой календаря: системное окно выбора даты открывается рядом с кнопкой */
.date-pick{position:relative;display:inline-flex}
.date-pick input[type="date"]{
  position:absolute;
  left:0;
  bottom:0;
  width:100%;
  height:0;
  padding:0;
  border:0;
  opacity:0;
  pointer-events:none;
  color-scheme:dark;
}

/* ===== Спиннер ===== */
.spinner-box{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:16px;
  padding:14px;
  background:#0d2818;
  border:1px solid #1a4d3a;
  border-radius:12px;
  color:#00e68a;
  font-weight:500;
}
.spinner{
  width:22px;height:22px;
  border:3px solid #1a4d3a;
  border-top-color:#00e68a;
  border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ===== Прогресс-бар ===== */
.progress-box{
  margin-top:16px;
  padding:16px;
  background:#0d2818;
  border:1px solid #1a4d3a;
  border-radius:12px;
}
.progress-label{
  font-size:14px;
  font-weight:500;
  color:#00e68a;
  margin-bottom:10px;
}
.progress-track{
  width:100%;
  height:10px;
  background:#1a4d3a;
  border-radius:6px;
  overflow:hidden;
}
.progress-fill{
  height:100%;
  background:#00e68a;
  border-radius:6px;
  transition:width .3s ease;
}

/* ===== Календарь (date input) тёмная тема ===== */
input[type="date"]{
  color-scheme:dark;
}

/* ===== Статистика (создание) ===== */
.stats{
  margin-top:16px;
  padding:16px;
  background:#0d2818;
  border:1px solid #1a4d3a;
  border-radius:12px;
}
.stats h3{margin:0 0 10px;font-size:16px;color:#00e68a}
.stat-row{
  padding:6px 0;
  font-size:14px;
  color:#c0c8d4;
  border-bottom:1px solid #1a4d3a;
}
.stat-row:last-child{border-bottom:none}

/* ===== Кнопки скачивания ===== */
.download-list{margin-top:16px}
.download-list h3{margin:0 0 10px;font-size:16px;color:#e0e6ed}
.download-btn{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  margin-bottom:8px;
  background:#0d1525;
  border:1px solid #1e2a3a;
  border-radius:12px;
  text-decoration:none;
  color:#00e68a;
  transition:background .15s;
}
.download-btn:hover{background:#141f33}
.dl-icon{
  font-size:22px;
  font-weight:700;
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  background:#00e68a;
  color:#0a0e1a;
  border-radius:10px;
  flex-shrink:0;
}
.download-btn small{color:#6b7b8d;font-size:12px}

/* ===== Отчёт проверки ===== */
.check-report{margin-top:16px}
.report-status{
  padding:12px 16px;
  border-radius:12px;
  font-weight:600;
  font-size:15px;
  margin-bottom:12px;
}
.status-ok{background:#0d2818;color:#00e68a;border:1px solid #1a4d3a}
.status-warn{background:#2d2005;color:#fbbf24;border:1px solid #5c4a14}
.status-error{background:#3b1419;color:#f87171;border:1px solid #6b2028}

.report-section{
  padding:12px 16px;
  border-radius:12px;
  margin-bottom:10px;
}
.report-section h4{margin:0 0 8px;font-size:14px}
.report-errors{background:#3b1419;border:1px solid #6b2028}
.report-errors h4{color:#f87171}
.report-warnings{background:#2d2005;border:1px solid #5c4a14}
.report-warnings h4{color:#fbbf24}
.report-info{background:#0d1525;border:1px solid #1e2a3a}
.report-info h4{color:#8896a6}

.report-item{
  padding:4px 0;
  font-size:14px;
  color:#c0c8d4;
  white-space:pre-wrap;
}
.report-hr{
  border:none;
  border-top:1px solid #1e2a3a;
  margin:8px 0;
}

/* ===== История ===== */
.history-empty{
  text-align:center;
  color:#6b7b8d;
  padding:30px 0;
  font-size:15px;
}
.history-card{
  background:#0d1525;
  border:1px solid #1e2a3a;
  border-radius:12px;
  padding:14px 16px;
  margin-bottom:10px;
}
.history-header{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
  flex-wrap:wrap;
}
.history-badge{
  display:inline-block;
  padding:3px 10px;
  border-radius:8px;
  font-size:12px;
  font-weight:600;
}
.badge-create{background:#1a3a4d;color:#38bdf8}
.badge-check{background:#1a2a3a;color:#a5b4c8}
.badge-ok{background:#0d2818;color:#00e68a}
.badge-warn{background:#2d2005;color:#fbbf24}
.badge-error{background:#3b1419;color:#f87171}
.history-time{
  margin-left:auto;
  font-size:12px;
  color:#6b7b8d;
}
.history-body strong{
  font-size:14px;
  color:#e0e6ed;
}
.history-meta{
  font-size:13px;
  color:#8896a6;
  margin-top:4px;
}
.history-files{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.history-dl{
  display:inline-block;
  padding:4px 12px;
  background:#0d2818;
  border:1px solid #1a4d3a;
  border-radius:8px;
  color:#00e68a;
  font-size:12px;
  font-weight:500;
  text-decoration:none;
  transition:background .15s;
}
.history-dl:hover{background:#14382a}

/* ===== Адаптивность ===== */
@media (max-width:720px){
  .grid{grid-template-columns:1fr}
  .field.full{grid-column:span 1}
  .tabs{flex-direction:column;gap:0}
  .tab{text-align:left}
}
