/* Rymatic CRM: a tool for one person. Dense, readable, no decoration. */
:root {
    --tlo: #f6f7f9;
    --karta: #fff;
    --ramka: #dfe3e8;
    --tekst: #1b1f24;
    --tekst-slaby: #5b6672;
    --akcent: #0b5fff;
    --ok: #0f7b4f;
    --ostrzezenie: #9a6700;
    --blad: #b42318;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--tekst);
    background: var(--tlo);
}

a { color: var(--akcent); }

header.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid var(--ramka);
}

header.topbar .brand { font-weight: 700; letter-spacing: -0.2px; }
header.topbar nav { display: flex; gap: 14px; flex: 1; }
header.topbar nav a { text-decoration: none; color: var(--tekst-slaby); padding: 4px 2px; }
header.topbar nav a:hover { color: var(--tekst); }
header.topbar nav a.active { color: var(--tekst); font-weight: 600; box-shadow: inset 0 -2px 0 var(--akcent); }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0; }

.card {
    background: var(--karta);
    border: 1px solid var(--ramka);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.card > header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ramka);
}

.card > header .count {
    font-size: 13px;
    color: var(--tekst-slaby);
    background: var(--tlo);
    border-radius: 10px;
    padding: 1px 8px;
}

.card .body { padding: 12px 16px; }

/* A wide table scrolls inside its own card instead of pushing the page out of shape. */
.card { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--ramka); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tekst-slaby); border-top: 0; }
tbody tr:hover { background: #fafbfc; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
tr.expired td { color: var(--tekst-slaby); }

.tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--tlo);
    border: 1px solid var(--ramka);
    white-space: nowrap;
}
.tag.p1, .tag.klient { background: #e7f5ee; border-color: #b7e0c9; color: var(--ok); }
.tag.p1_tech, .tag.cieple, .tag.warm { background: #fff6e5; border-color: #f0d9a8; color: var(--ostrzezenie); }
.tag.odrzucona, .tag.rejected { background: #fdecea; border-color: #f5c2bd; color: var(--blad); }
.tag.mocny, .tag.strong { background: #e7f5ee; border-color: #b7e0c9; color: var(--ok); }
.tag.muted, .tag.weak { color: var(--tekst-slaby); }

.muted { color: var(--tekst-slaby); font-size: 13px; }
.empty { padding: 16px; color: var(--tekst-slaby); }

button, .button {
    font: inherit;
    font-size: 13px;
    padding: 5px 11px;
    border: 1px solid var(--ramka);
    border-radius: var(--radius);
    background: #fff;
    color: var(--tekst);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button:hover, .button:hover { background: var(--tlo); }
button.primary { background: var(--akcent); border-color: var(--akcent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }

input[type=text], input[type=date], input[type=email], input[type=number], input[type=password], select, textarea {
    font: inherit;
    font-size: 14px;
    padding: 6px 8px;
    border: 1px solid var(--ramka);
    border-radius: var(--radius);
    background: #fff;
    max-width: 100%;
}
textarea { width: 100%; min-height: 70px; }
label { font-size: 13px; color: var(--tekst-slaby); display: block; margin-bottom: 3px; }

form.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
form.grid .full { grid-column: 1 / -1; }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert.success { background: #e7f5ee; border: 1px solid #b7e0c9; color: var(--ok); }
.alert.error { background: #fdecea; border: 1px solid #f5c2bd; color: var(--blad); }
.alert.warning { background: #fff6e5; border: 1px solid #f0d9a8; color: var(--ostrzezenie); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.login-box { max-width: 320px; margin: 10vh auto; }
.login-box .card .body > * + * { margin-top: 12px; }

dl.data { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 14px; }
dl.data dt { color: var(--tekst-slaby); }
dl.data dd { margin: 0; }

nav.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
nav.pagination .button { min-width: 34px; text-align: center; }
nav.pagination .current { background: var(--akcent); border-color: var(--akcent); color: #fff; font-weight: 600; }
nav.pagination .disabled { color: var(--tekst-slaby); opacity: 0.5; cursor: default; }

@media (max-width: 720px) {
    header.topbar { flex-wrap: wrap; }
    main { padding: 12px; }
    th, td { padding: 6px 10px; }
}

/* Prospect score bands (spec 14.3): the colour says what to do, the number says the order. */
.tag.band-a { background: #e7f5ee; border-color: #b7e0c9; color: var(--ok); font-weight: 600; }
.tag.band-b { background: #fff6e5; border-color: #f0d9a8; color: var(--ostrzezenie); }
.tag.band-c { color: var(--tekst-slaby); }
.tag.band-d { color: var(--tekst-slaby); opacity: .7; }
.score-index { font-size: 28px; font-weight: 600; line-height: 1; }
.tag.band-missing { background: #fff6e5; border-color: #f0d9a8; color: var(--ostrzezenie); }
/* Why this lead is worth writing to (spec 14.8): a fact, not a slogan. */
.reason { font-size: 13px; color: var(--tekst); margin-top: 2px; }
/* The reason needs room to be read in one glance, not six wrapped lines. */
.company-cell { min-width: 260px; }
