* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, sans-serif; color: #1f2937; background: #f3f4f6; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }
.side { width: 200px; background: #111827; color: #e5e7eb; padding: 18px 0; flex-shrink: 0; }
.side .brand { font-size: 18px; font-weight: 700; padding: 0 18px 16px; }
.side .brand span { color: #60a5fa; }
.side nav a { display: block; padding: 9px 18px; color: #d1d5db; }
.side nav a:hover { background: #1f2937; text-decoration: none; color: #fff; }
.side nav a.muted { color: #6b7280; margin-top: 20px; font-size: 12px; }
.main { flex: 1; padding: 24px 28px; max-width: 1400px; }

h1 { margin: 0 0 14px; font-size: 22px; }
h2 { margin: 26px 0 10px; font-size: 16px; }
h3 { margin: 0 0 12px; font-size: 15px; }
.hint { font-weight: 400; font-size: 12px; color: #6b7280; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
th { background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
tr:last-child td { border-bottom: none; }
table.compact th, table.compact td { padding: 5px 8px; font-size: 12px; }
.empty { color: #9ca3af; text-align: center; padding: 14px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #e0e7ff; color: #3730a3; }
.badge.kind-won { background: #dcfce7; color: #166534; }
.badge.kind-lost { background: #fee2e2; color: #991b1b; }
.badge.kind-hold { background: #fef3c7; color: #92400e; }

.funnel { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.funnel-cell { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; text-align: center; color: #1f2937; }
.funnel-cell:hover { border-color: #93c5fd; text-decoration: none; }
.funnel-cell .n { font-size: 22px; font-weight: 700; }
.funnel-cell .lbl { font-size: 11px; color: #64748b; }
.funnel-cell.kind-won { border-color: #86efac; }
.funnel-cell.kind-lost { opacity: .65; }
.funnel-cell.kind-hold { border-color: #fcd34d; }

label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: #374151; }
input, select, textarea { width: 100%; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; margin-top: 3px; }
form.inline, .inline { display: inline-flex; gap: 8px; align-items: end; flex-wrap: wrap; }
form.inline label { margin: 0; }
form.inline input, form.inline select { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; margin: 0; }

button, .btn { background: #1d4ed8; color: #fff; border: none; border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
button:hover, .btn:hover { background: #1e40af; text-decoration: none; }
.btn.ghost { background: #fff; color: #1d4ed8; border: 1px solid #93c5fd; }

.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.check button { display: flex; gap: 8px; align-items: center; width: 100%; background: #f8fafc; color: #1f2937; border: 1px solid #e5e7eb; font-weight: 500; padding: 7px 10px; text-align: left; }
.check .box { display: inline-flex; width: 18px; height: 18px; border: 1px solid #cbd5e1; border-radius: 4px; align-items: center; justify-content: center; background: #fff; font-size: 12px; flex-shrink: 0; }
.check.st-done button { background: #f0fdf4; border-color: #86efac; }
.check.st-done .box { background: #22c55e; color: #fff; border-color: #22c55e; }
.check.st-issue button { background: #fef2f2; border-color: #fca5a5; }
.check.st-issue .box { background: #ef4444; color: #fff; border-color: #ef4444; }
.check.st-na button { opacity: .55; }
.mark-opts { margin-top: 10px; }
.mark-opts form { margin: 4px 0; font-size: 12px; }
.mark-opts button { padding: 3px 8px; font-size: 11px; background: #64748b; }

.callform { display: flex; gap: 8px; margin-bottom: 12px; }
.callform select { width: 170px; }
.callform input { flex: 1; }
.callform button { white-space: nowrap; }
.note { border-left: 3px solid #bfdbfe; padding: 6px 10px; margin: 8px 0; background: #f8fafc; border-radius: 0 6px 6px 0; }
.note .meta { font-size: 11px; color: #64748b; margin-bottom: 2px; }
dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0 0 12px; }
dt { font-size: 12px; color: #64748b; } dd { margin: 0; }
.form { max-width: 560px; }
.alert { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.actions form { display: inline-flex; gap: 6px; }
.actions input { width: 150px; }
.actions button { padding: 4px 10px; font-size: 12px; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 28px; width: 320px; }
.login-card .brand.center { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.login-card .brand span { color: #2563eb; }
.login-card button { width: 100%; margin-top: 6px; }
.kanban { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; }
.kcol { min-width: 200px; flex: 1 0 200px; background: #eef2f7; border-radius: 8px; padding: 8px; }
.kcol.over { outline: 2px dashed #3b82f6; }
.kcol.kind-hold { background: #fef3c7; }
.khead { font-weight: 700; font-size: 12px; padding: 4px 6px 8px; text-transform: uppercase; letter-spacing: .03em; color: #475569; }
.kcard { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; color: #1f2937; cursor: grab; }
.kcard:hover { text-decoration: none; border-color: #93c5fd; }
.kcard.dragging { opacity: .5; }
.kmeta { font-size: 11px; color: #64748b; }
button.mini { padding: 1px 7px; font-size: 11px; background: #94a3b8; }
.apply-form { width: 520px; max-width: 95vw; }
