@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800;900&display=swap");

:root {
  --green: #166534;
  --green-2: #15803d;
  --blue: #1d4ed8;
  --line: #dbeafe;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
  --font-ui: "Roboto", sans-serif;
  --font-display: "Roboto", sans-serif;
  --font-print: "Roboto", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-ui) !important;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button,
input,
select,
textarea,
a,
.btn,
.mini-btn,
.user-badge,
.overdue-pill,
.year-select {
  font-family: var(--font-ui) !important;
}
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #f0fdf4, #eff6ff); }
.login-card { width: min(430px, 100%); background: #fff; border: 1px solid #bbf7d0; border-radius: 22px; padding: 30px; box-shadow: 0 20px 60px rgba(15,23,42,.12); }
.brand-mark { font-size: 46px; }
.login-card h1 { margin: 8px 0; color: #14532d; font-size: 24px; line-height: 1.2; }
.login-card p { color: var(--muted); margin-bottom: 22px; font-weight: 700; font-size: 13px; text-transform: uppercase; }
label { display: grid; gap: 7px; font-weight: 800; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 11px 12px; font: inherit; font-family: var(--font-ui) !important; color: var(--text); background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.btn { border: 0; border-radius: 10px; padding: 9px 13px; font-size: 12px; line-height: 1.2; font-weight: 700; cursor: pointer; transition: transform .15s ease, filter .15s ease; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { filter: brightness(.96); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: wait; }
.btn-primary, .btn-green { background: var(--green-2); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-muted { background: #e2e8f0; color: #334155; }
.btn-portal {
  border: 1px solid #bbf7d0;
  background: linear-gradient(135deg, #14532d, #15803d);
  color: #fff;
  box-shadow: 0 8px 18px rgba(21,128,61,.18);
}
.btn-portal:hover {
  color: #fff;
}
.app-header { margin: 12px; padding: 16px; background: #fff; border: 1px solid #bbf7d0; border-radius: 18px; box-shadow: 0 8px 26px rgba(15,23,42,.06); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.title-wrap { display: flex; gap: 14px; align-items: center; min-width: 280px; }
.header-icon { font-size: 34px; }
.app-header h1 { margin: 0; color: #14532d; font-size: 22px; line-height: 1.15; }
.app-header p { margin: 4px 0 0; color: #64748b; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.user-badge, .overdue-pill { padding: 8px 10px; background: #f1f5f9; border-radius: 10px; color: #334155; font-size: 12px; font-weight: 700; }
.year-select { width: auto; min-width: 96px; font-size: 12px; font-weight: 700; color: var(--green); }
.stats-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 18px; margin: 0 12px 18px; }
.stats-panel { background: #fff; padding: 18px; border-radius: 18px; box-shadow: 0 6px 22px rgba(15,23,42,.05); }
.stats-month { border-top: 7px solid #16a34a; }
.stats-team { border-top: 7px solid #2563eb; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 16px; text-transform: uppercase; color: #334155; }
.mini-btn { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; color: #475569; cursor: pointer; }
.month-grid { display: grid; grid-template-columns: repeat(6, minmax(72px, 1fr)); gap: 10px; }
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 10px; }
.stat-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 13px; text-align: center; cursor: pointer; background: #f8fafc; transition: .2s ease; }
.stat-card:hover, .stat-card.active { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,23,42,.08); border-color: #22c55e; }
.stat-label { font-size: 12px; font-weight: 900; color: #2563eb; text-transform: uppercase; }
.stat-number { font-size: 26px; font-weight: 900; color: #0f172a; line-height: 1.1; margin-top: 4px; }
.toolbar { display: flex; gap: 12px; margin: 0 12px 14px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 360px; display: block; }
.search-box span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); }
.search-box input { padding-left: 42px; }
.toolbar select { width: auto; min-width: 170px; font-size: 12px; font-weight: 700; }
.table-shell { margin: 0 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 28px rgba(15,23,42,.08); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1440px; }
thead { background: #15803d; color: #fff; text-transform: uppercase; }
th, td { padding: 14px 12px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
th { text-align: left; font-size: 11px; letter-spacing: 0; cursor: default; }
th[data-sort] { cursor: pointer; }
tbody tr:hover { background: #f8fafc; }
.row-new { background: #eff6ff; }
.row-overdue { background: #fef2f2; }
.truncate-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner-cell { font-weight: 900; min-width: 170px; }
.new-tag, .late-tag { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 6px; color: #fff; font-size: 10px; font-weight: 900; }
.new-tag { background: #2563eb; animation: blink 1.4s infinite; }
.late-tag { background: #dc2626; }
@keyframes blink { 50% { opacity: .35; } }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 110px; padding: 5px 9px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.status-new { background: #2563eb; }
.status-checking { background: #f59e0b; }
.status-team { background: #7c3aed; }
.status-company { background: #0891b2; }
.status-done { background: #16a34a; }
.status-unreachable { background: #e11d48; }
.status-returned { background: #334155; }
.badge.overdue { background: #b91c1c; }
.quick-select { min-width: 150px; padding: 8px; border-radius: 9px; font-size: 12px; }
.update-meta { min-width: 150px; color: #475569; font-size: 12px; line-height: 1.4; }
.update-meta strong { display: block; color: #0f172a; font-size: 12px; }
.row-actions { display: flex; justify-content: center; gap: 8px; }
.icon-btn { border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; padding: 7px 9px; cursor: pointer; }
.pager-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 12px 40px; color: #475569; font-weight: 800; flex-wrap: wrap; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination button { border: 1px solid #cbd5e1; background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 900; cursor: pointer; }
.pagination button.active { background: #15803d; color: #fff; border-color: #15803d; }
.modal { border: 0; padding: 0; background: transparent; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.modal::backdrop { background: rgba(15,23,42,.68); backdrop-filter: blur(5px); }
.modal-card { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 70px rgba(15,23,42,.24); }
.modal-card.small { width: min(430px, 100%); margin: auto; }
.modal-head { padding: 16px 18px; background: #15803d; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; text-transform: uppercase; }
.icon-close { border: 0; background: transparent; color: #fff; font-size: 28px; cursor: pointer; }
.modal-body { padding: 18px; display: grid; gap: 14px; max-height: calc(100vh - 190px); overflow: auto; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid #e2e8f0; }
.form-message { margin-top: 10px; min-height: 20px; font-weight: 800; color: #dc2626; }
.toast { position: fixed; right: 18px; bottom: 18px; background: #0f172a; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: 0 14px 40px rgba(15,23,42,.24); transform: translateY(120px); transition: .25s ease; z-index: 20; max-width: 360px; }
.toast.show { transform: translateY(0); }
.print-dialog { width: min(1100px, calc(100vw - 24px)); }
.print-card { border-radius: 12px; }
.login-card h1,
.app-header h1,
.panel-head h2,
.modal-head h2,
.stat-number,
.kpi-card strong,
.print-title h1 {
  font-family: var(--font-display);
}
.print-area { padding: 24px; background: #fff; color: #000; font-family: var(--font-print); }
.print-org { font-weight: 700; text-transform: uppercase; line-height: 1.5; }
.print-title { border: 2px solid #15803d; margin: 20px 0; padding: 14px; text-align: center; }
.print-title h1 { margin: 0 0 8px; font-size: 22px; }
.print-area table { min-width: auto; font-size: 15px; }
.print-area th, .print-area td { border: 1px solid #000; padding: 8px; color: #000; }
.print-area thead { background: #f1f5f9; color: #000; }
.signature { margin-top: 28px; text-align: right; padding-right: 70px; }
.report-page { padding-bottom: 34px; }
.report-header { margin-bottom: 18px; }
.report-kpis { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; margin: 0 12px 16px; }
.kpi-card { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #2563eb; border-radius: 12px; padding: 14px; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.kpi-card span { display: block; color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; }
.kpi-card strong { font-size: 30px; line-height: 1; color: #0f172a; }
.kpi-card.success { border-left-color: #16a34a; }
.kpi-card.warning { border-left-color: #f59e0b; }
.kpi-card.danger { border-left-color: #dc2626; }
.kpi-card.neutral { border-left-color: #64748b; }
.report-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; margin: 0 12px; align-items: start; }
.report-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.report-panel.wide { grid-column: span 2; }
.report-note { color: #64748b; font-size: 12px; font-weight: 800; }
.bar-chart { min-height: 235px; display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr)); align-items: end; gap: 10px; padding-top: 18px; overflow-x: auto; }
.bar-item { min-width: 42px; display: grid; justify-items: center; gap: 7px; }
.bar-value { font-size: 12px; color: #334155; font-weight: 900; }
.bar-track { height: 168px; width: 100%; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #cbd5e1; }
.bar-fill { width: min(34px, 70%); background: #15803d; border-radius: 7px 7px 0 0; min-height: 6px; }
.bar-label { font-size: 11px; color: #64748b; font-weight: 900; }
.report-list { display: grid; gap: 12px; }
.report-row { display: grid; gap: 7px; }
.report-row-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #334155; font-weight: 800; }
.report-row-top strong { color: #0f172a; }
.thin-track { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.thin-fill { height: 100%; background: #2563eb; border-radius: inherit; }
.compact-table-wrap { overflow-x: auto; }
.compact-table { min-width: 900px; font-size: 12px; }
.compact-table th, .compact-table td { padding: 10px 12px; }
.compact-table .badge { min-width: 90px; font-size: 10px; }
.matrix-table-wrap { overflow-x: auto; }
.matrix-table { min-width: 980px; font-size: 12px; text-align: center; }
.matrix-table th, .matrix-table td { padding: 9px 10px; }
.matrix-table th:first-child, .matrix-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
.matrix-table thead th:first-child { background: #15803d; color: #fff; z-index: 2; }
.matrix-team { font-weight: 700; color: #0f172a; min-width: 120px; }
.matrix-table td.has-value { background: #ecfdf5; color: #166534; font-weight: 800; }
.matrix-total { background: #eff6ff; color: #1d4ed8; font-weight: 900; }
.matrix-footer td { background: #f1f5f9; font-weight: 900; color: #0f172a; }
.settings-page { padding-bottom: 34px; }
.settings-layout { margin: 0 12px; }
.settings-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.settings-table-wrap { overflow-x: auto; }
.archive-wrap { margin-top: 20px; }
.settings-subtitle { margin: 4px 0 10px; color: #334155; font-size: 14px; text-transform: uppercase; }
.settings-table { min-width: 820px; font-size: 13px; }
.settings-table th, .settings-table td { padding: 12px; }
.settings-table code { background: #f1f5f9; border-radius: 7px; padding: 4px 7px; color: #334155; font-family: var(--font-ui); font-weight: 700; }
.team-name-cell { font-weight: 800; color: #0f172a; }
.inactive-row { color: #94a3b8; background: #f8fafc; }
.soft-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 800; }
.soft-badge.ok { background: #dcfce7; color: #166534; }
.soft-badge.muted { background: #e2e8f0; color: #64748b; }
.check-row { display: flex; grid-template-columns: none; align-items: center; gap: 9px; text-transform: none; font-size: 13px; }
.check-row input { width: auto; }
@media (max-width: 900px) {
  .app-header { align-items: stretch; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .month-grid, .team-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .field-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .toolbar select { width: 100%; }
  .btn { min-height: 42px; }
  .report-kpis { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .report-layout { grid-template-columns: 1fr; }
  .report-panel.wide { grid-column: span 1; }
  .bar-chart { grid-template-columns: repeat(12, 42px); }
}
