*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; font-size: 13px; background: #f0f2f5; color: #222; }

.topbar { background: linear-gradient(135deg, #1a3a5c 0%, #1a5276 60%, #1f618d 100%); color: #fff; padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.topbar-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 20px; }
.topbar h1 { font-size: 17px; font-weight: bold; letter-spacing: .2px; }
.topbar .sub { font-size: 11px; opacity: .8; margin-top: 3px; }
.topbar-right { display: flex; gap: 8px; }
.topbar-brand { background: rgba(0,0,0,.2); border-top: 1px solid rgba(255,255,255,.1); padding: 5px 20px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.topbar-brand a { color: #aed6f1; text-decoration: none; font-weight: bold; }
.topbar-brand a:hover { color: #fff; }
.topbar-free { background: #f39c12; color: #fff; font-size: 10px; font-weight: bold; padding: 2px 7px; border-radius: 3px; letter-spacing: .3px; }
.btn { border: none; border-radius: 4px; padding: 7px 16px; font-size: 12px; cursor: pointer; font-weight: bold; }
.btn-print { background: #27ae60; color: #fff; }
.btn-reset { background: #7f8c8d; color: #fff; }

.container { max-width: 1300px; margin: 0 auto; padding: 14px 12px; }

.card { background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; margin-bottom: 14px; }
.card-head { background: #2471a3; color: #fff; padding: 9px 14px; font-weight: bold; font-size: 12px; border-radius: 5px 5px 0 0; cursor: pointer; user-select: none; }
.card-head:hover { background: #1a5276; }
.card-body { padding: 12px 14px; }

/* Шапка формы */
.form-head-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.fh-field { display: flex; flex-direction: column; gap: 3px; }
.fh-field label { font-size: 11px; color: #666; }
.fh-field input, .fh-field select { border: 1px solid #bdc3c7; border-radius: 4px; padding: 5px 8px; font-size: 13px; }
.fh-field input:focus, .fh-field select:focus { outline: none; border-color: #2471a3; }

/* Ставки */
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.rate-row { display: flex; flex-direction: column; gap: 2px; background: #f4f6f8; border: 1px solid #d5d8dc; border-radius: 4px; padding: 7px 10px; }
.rate-row label { font-size: 11px; color: #555; }
.rate-row .rate-inp { display: flex; align-items: center; gap: 4px; }
.rate-row input { border: 1px solid #bdc3c7; border-radius: 3px; padding: 3px 6px; font-size: 13px; width: 90px; }
.rate-row .kbk { font-size: 10px; color: #888; margin-top: 2px; }

/* Таблица сотрудников */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; font-size: 12px; width: 100%; }
th { background: #1a5276; color: #fff; padding: 7px 8px; text-align: center; border: 1px solid #154360; white-space: nowrap; }
th.gr1 { background: #1a5276; }
th.gr2 { background: #145a32; }
th.gr3 { background: #7b241c; }
td { border: 1px solid #d5d8dc; padding: 5px 7px; vertical-align: middle; }
tr:nth-child(even) td { background: #f8fbfe; }
tr:hover td { background: #eaf4fb !important; }

td.name-cell input { border: none; width: 100%; min-width: 140px; font-size: 12px; background: transparent; }
td.name-cell input:focus { outline: 1px solid #2471a3; background: #eaf4fb; }
td.sal-cell input { border: none; width: 80px; font-size: 12px; background: transparent; text-align: right; }
td.sal-cell input:focus { outline: 1px solid #2471a3; background: #eaf4fb; }
td.chk-cell { text-align: center; }
td.val { text-align: right; white-space: nowrap; }
td.val-empl { background: #eafaf1; text-align: right; white-space: nowrap; }
td.val-empr { background: #fdf2f8; text-align: right; white-space: nowrap; }
td.val-nruki { background: #fef9e7; text-align: right; white-space: nowrap; font-weight: bold; color: #7d6608; }
td.val-itogo { background: #f0f3ff; text-align: right; white-space: nowrap; font-weight: bold; color: #1a237e; }

tr.total-row td { background: #d6eaf8 !important; font-weight: bold; }
tr.total-row td.val-empl { background: #d5f5e3 !important; }
tr.total-row td.val-empr { background: #f5d5e9 !important; }
tr.total-row td.val-nruki { background: #fef9e7 !important; }
tr.total-row td.val-itogo { background: #dce0ff !important; }

.btn-del { background: #e74c3c; color: #fff; border: none; border-radius: 3px; padding: 3px 7px; cursor: pointer; font-size: 11px; }
.btn-del:hover { background: #c0392b; }
.btn-add { background: #27ae60; color: #fff; border: none; border-radius: 4px; padding: 6px 14px; cursor: pointer; font-size: 12px; font-weight: bold; margin-bottom: 8px; }
.btn-add:hover { background: #1e8449; }

/* Форма 200 */
.f200-table th { font-size: 11px; }
.f200-table td.code { font-weight: bold; color: #1a5276; white-space: nowrap; font-size: 12px; }
.f200-table td.fname { color: #333; font-size: 12px; }
.f200-table td.fval { text-align: right; font-weight: bold; font-size: 12px; white-space: nowrap; }
.f200-table td.ftotal { text-align: right; font-weight: bold; font-size: 12px; background: #fef9e7 !important; color: #7d6608; white-space: nowrap; }
.f200-table tr.f-section td { background: #d6eaf8; font-weight: bold; color: #1a5276; font-size: 12px; }

/* Легенда */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 11px; }
.leg-item { display: flex; align-items: center; gap: 5px; }
.leg-box { width: 14px; height: 14px; border-radius: 3px; }

/* Инфо-бокс */
.infobox { background: #eaf4fb; border-left: 4px solid #2471a3; padding: 8px 12px; border-radius: 3px; font-size: 12px; color: #555; margin-bottom: 10px; line-height: 1.6; }

/* Итоговые карточки */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sc { border-radius: 5px; padding: 10px 12px; text-align: center; border: 1px solid; }
.sc .sc-l { font-size: 10px; margin-bottom: 4px; }
.sc .sc-v { font-size: 17px; font-weight: bold; }
.sc .sc-s { font-size: 10px; margin-top: 2px; opacity: .7; }
.sc-blue  { background: #eaf4fb; border-color: #a9cce3; color: #1a5276; }
.sc-green { background: #eafaf1; border-color: #a9dfb5; color: #1e8449; }
.sc-red   { background: #fdf2f8; border-color: #f1a7d3; color: #7b241c; }
.sc-yel   { background: #fef9e7; border-color: #f7dc6f; color: #7d6608; }
.sc-dark  { background: #f0f3ff; border-color: #b0baea; color: #1a237e; }

.tip { font-size: 10px; color: #888; font-style: italic; }

/* Кабинет налогоплательщика */
.cab-row { border-bottom: 1px solid #eaf0f6; padding: 12px 0 10px; }
.cab-row:last-child { border-bottom: none; }
.cab-label { color: #1a5276; font-size: 12px; font-weight: bold; margin-bottom: 8px; }
.cab-iv-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 12px; color: #555; }
.cab-iv-label { min-width: 200px; font-style: italic; }
.cab-field { display: flex; align-items: stretch; border: 1px solid #bdc3c7; border-radius: 3px; background: #fff; overflow: hidden; flex: 1; max-width: 280px; }
.cab-field input { border: none; outline: none; padding: 6px 10px; font-size: 13px; width: 100%; background: transparent; text-align: right; color: #222; }
.cab-field .kzt { padding: 6px 8px; color: #888; font-size: 12px; border-left: 1px solid #e0e0e0; background: #f8f9fa; white-space: nowrap; }
.cab-field.cab-total { background: #f4f6f8; }
.cab-field.cab-total input { background: #f4f6f8; color: #444; font-weight: bold; }
.cab-months-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cab-month-label { color: #1a5276; font-size: 11px; font-weight: bold; margin-bottom: 4px; }

/* FAQ и об инструменте */
.faq-section { background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; margin-bottom: 14px; padding: 20px 24px; }
.faq-section h2 { font-size: 16px; color: #1a3a5c; margin-bottom: 16px; font-weight: bold; }
.faq-item { border-bottom: 1px solid #eaf0f6; padding: 12px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 13px; color: #1a5276; font-weight: bold; margin-bottom: 6px; cursor: pointer; }
.faq-item p { font-size: 12px; color: #444; line-height: 1.7; }
.faq-item ul { font-size: 12px; color: #444; line-height: 1.8; padding-left: 18px; margin-top: 4px; }

.about-author { background: #f4f6f8; border: 1px solid #d5d8dc; border-radius: 6px; margin-bottom: 14px; padding: 16px 24px; font-size: 12px; color: #444; line-height: 1.7; }
.about-author h2 { font-size: 14px; color: #1a3a5c; margin-bottom: 8px; font-weight: bold; }
.about-author h3 { font-size: 12px; color: #1a5276; margin: 10px 0 5px; font-weight: bold; }
.about-author ul { padding-left: 18px; }
.about-author a { color: #2471a3; text-decoration: none; }
.about-author a:hover { text-decoration: underline; }

@media print {
  body { background: #fff; font-size: 11px; }
  .topbar { background: #1a5276 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
  .card { border: 1px solid #999; margin-bottom: 8px; page-break-inside: avoid; }
  th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  td.val-empl { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  td.val-empr { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  td.ftotal   { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
