/* DeliReport v3 — стили объединены из легаси-шаблонов (вид не менялся). */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a2e; }

/* ---------- шапка ---------- */
.header { background: #1a1a2e; color: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 18px; }
.header .version { font-size: 11px; color: #9ca3af; font-weight: 400; }
.header a { color: #a5b4fc; text-decoration: none; margin-left: 16px; font-size: 14px; }
.header a:hover { text-decoration: underline; }
.header .right { display: flex; align-items: center; gap: 8px; }
.header .who { font-size: 13px; color: #a5b4fc; }
.hamburger { display: none; background: none; border: none; color: #a5b4fc; font-size: 24px; cursor: pointer; padding: 4px; line-height: 1; }

/* ---------- каркас ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.06); padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 16px; margin-bottom: 16px; color: #374151; }
.row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { flex: 1; min-width: 120px; background: #f8fafc; border-radius: 8px; padding: 12px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 700; color: #4f46e5; }
.stat .label { font-size: 11px; color: #6b7280; margin-top: 2px; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- таблицы ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: center; border-bottom: 1px solid #e5e7eb; }
th { background: #f9fafb; font-weight: 600; color: #374151; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #f9fafb; }
.scroll-x { overflow-x: auto; }

/* ---------- бейджи ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.green, .badge.ok { background: #dcfce7; color: #16a34a; }
.badge.red, .badge.no { background: #fef2f2; color: #dc2626; }
.badge.gray { background: #f3f4f6; color: #6b7280; }
.badge.amber { background: #fef3c7; color: #d97706; }
.badge.manager { background: #dbeafe; color: #1d4ed8; }
.badge.staff { background: #f3f4f6; color: #6b7280; }

/* ---------- кнопки ---------- */
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font-size: 14px; text-decoration: none; cursor: pointer; border: none; }
.btn.primary { background: #4f46e5; color: #fff; }
.btn.primary:hover { background: #4338ca; }
.btn.outline { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.btn.outline:hover { background: #f9fafb; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.muted { background: #e5e7eb; color: #374151; }

/* ---------- алерты ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert.info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ---------- дашборд: статусы ---------- */
.missing-list { display: flex; gap: 8px; flex-wrap: wrap; }
.missing-item { padding: 6px 12px; border-radius: 6px; font-size: 13px; }
.missing-item.ok { background: #dcfce7; color: #16a34a; }
.missing-item.no { background: #fef2f2; color: #dc2626; }
.comment-cell { font-size: 11px; color: #92400e; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- формы ---------- */
.form-row { margin-bottom: 16px; }
label { display: block; margin-bottom: 4px; font-size: 13px; color: #6b7280; font-weight: 500; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px;
  background: #fff; font-family: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
input:disabled { background: #f9fafb; color: #374151; }
button[type="submit"] { padding: 12px; background: #4f46e5; color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; margin-top: 8px; }
button[type="submit"]:hover { background: #4338ca; }
.form-submit { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.back-link { display: inline-block; margin-bottom: 16px; color: #4f46e5; text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }
.calc-line { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #f8fafc; border-radius: 8px; margin-bottom: 8px; }
.calc-line .val { font-size: 18px; font-weight: 700; color: #4f46e5; }
.calc-line .lab { font-size: 13px; color: #6b7280; }
.comment-section { display: none; margin-top: 16px; padding: 12px 16px; background: #fef3c7; border-radius: 8px; border: 1px solid #fde68a; }
.comment-section label { font-size: 13px; color: #92400e; font-weight: 500; }
.comment-section .hint { font-size: 11px; color: #b45309; margin-top: 4px; }
.comment-box { margin-top: 12px; padding: 12px; background: #fef3c7; border-radius: 8px; font-size: 13px; color: #92400e; }
#client-error { display: none; }

/* ---------- отчёты: навигация по месяцам ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.month-nav a { color: #4f46e5; text-decoration: none; font-size: 14px; }
.month-nav a:hover { text-decoration: underline; }
.month-nav .cur { font-size: 18px; font-weight: 600; }

/* ---------- отчёт за месяц ---------- */
table.report { font-size: 13px; border-collapse: collapse; min-width: 800px; }
table.report th, table.report td { padding: 5px 6px; border: 1px solid #e5e7eb; text-align: center; }
table.report th { background: #f3f4f6; font-size: 11px; position: sticky; top: 0; z-index: 1; }
table.report td { white-space: nowrap; }
table.report tr:hover td { background: #f0f4ff; }
.staff-name { font-weight: 600; color: #374151; font-size: 11px; writing-mode: vertical-lr; text-orientation: mixed; height: 80px; }
.day-num { font-weight: 600; color: #6b7280; background: #f9fafb; }
td.mismatch { background: #fef2f2; }
td.empty { color: #d1d5db; }
.cell-sub { font-size: 10px; color: #6b7280; }
.cell-comment { font-size: 9px; color: #92400e; margin-top: 2px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-link { text-decoration: none; margin-left: 2px; font-size: 11px; }
.chart-wrap { height: 300px; margin-top: 16px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.charts-grid h3 { font-size: 13px; color: #6b7280; margin-bottom: 8px; }

/* ---------- отчёт по сотрудникам ---------- */
.employee-name { text-align: left; font-weight: 600; color: #374151; }
.grand-total td { background: #eef2ff; font-weight: 700; color: #1a1a2e; border-top: 2px solid #4f46e5; }
.num-col { font-weight: 600; }
.cost-row { font-size: 12px; color: #6b7280; font-weight: 400; }

/* ---------- сотрудники ---------- */
.users-table th, .users-table td { text-align: left; }
.btn-icon { display: none; }

/* ---------- ввод данных ---------- */
/* дозаполнение прошлых дат (v3.1.0) */
.backfill-missed { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.backfill-missed .lab { color: #6b7280; font-weight: 600; }
.backfill-day { display: inline-block; padding: 3px 9px; border-radius: 10px; background: #eef2ff; color: #4f46e5; font-weight: 600; text-decoration: none; }
.backfill-day:hover { background: #e0e7ff; }

/* ---------- вход ---------- */
body.auth { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); width: 360px; }
.login h1 { font-size: 22px; margin-bottom: 24px; text-align: center; color: #1a1a2e; }
.login h1 .version { font-size: 12px; color: #9ca3af; font-weight: 400; }
.login .error { color: #dc2626; font-size: 14px; text-align: center; margin-bottom: 12px; }
.login button { width: 100%; padding: 10px; }

/* ---------- мобильные ---------- */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .header { flex-wrap: wrap; padding: 12px 16px; }
  .header .right { display: none; flex-direction: column; width: 100%; gap: 4px; padding-top: 10px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
  .header .right.open { display: flex; }
  .header .right a { margin-left: 0; padding: 8px 0; }
  .header .right span { display: block; }
  .hamburger { display: block; }
  .container { padding: 12px 16px; }
  .card { padding: 16px; }
  table { font-size: 12px; }
  th, td { padding: 5px 4px; }
  .stat { min-width: 100px; }
  .stat .num { font-size: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .btn-text { display: none; }
  .btn-icon { display: inline; }
  .btn.danger { font-size: 11px; padding: 4px 6px; }
}
