:root {
    --bg: #e6dfd1;
    --bg-alt: #f7f2e8;
    --ink: #1f1a14;
    --ink-soft: #574c40;
    --line: #cec3b2;
    --accent: #b0331f;
    --accent-soft: #f2d8d1;
    --ok: #1f6b3a;
    --ok-soft: #d9ebe1;
    --warn: #8a5a00;
    --danger: #8c2717;
    --radius: 10px;
    --maxw: 980px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header / nav ---------- */
.admin-header { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.admin-nav { display: flex; align-items: center; gap: 18px; padding: 12px 0; flex-wrap: wrap; }
.admin-brand { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.admin-brand:hover { text-decoration: none; }
.admin-nav a { color: var(--ink-soft); font-size: .92rem; }
.admin-nav a.active, .admin-nav a:hover { color: var(--accent); text-decoration: none; }
.admin-logout { margin-left: auto; }

/* ---------- strona ---------- */
main.admin-container { padding-top: 26px; padding-bottom: 60px; }

h1 { font-size: 1.4rem; margin: 0 0 18px; }

.flash {
    background: var(--ok-soft);
    color: var(--ok);
    border: 1px solid #a9cdb4;
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 18px;
}

/* ---------- karty / stats ---------- */
.card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .num { font-size: 1.7rem; font-weight: 700; }
.stat .lbl { color: var(--ink-soft); font-size: .85rem; }

/* ---------- tabele ---------- */
table { width: 100%; border-collapse: collapse; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
th { background: var(--bg); font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; }
td.actions a { margin-right: 10px; font-size: .85rem; }
td.actions .danger { color: var(--danger); }
form.inline-form { display: inline; margin: 0; }
form.inline-form button.link-btn {
    background: none; border: none; padding: 0; margin-right: 10px;
    font: inherit; font-size: .85rem; color: var(--accent); cursor: pointer;
}
form.inline-form button.link-btn.danger { color: var(--danger); }
form.inline-form button.link-btn:hover { text-decoration: underline; filter: none; }

/* ---------- formularze ---------- */
form.card { display: block; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: .9rem; }
input[type="text"], input[type="password"], input[type="url"], input[type="number"], textarea, select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-size: .95rem;
    background: var(--bg-alt);
    color: var(--ink);
}
textarea { min-height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.svc-grid label { font-weight: 600; font-size: .9rem; }
.svc-grid select { margin-top: 4px; }
.hint { color: var(--ink-soft); font-size: .82rem; margin-top: 3px; }

button, .btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font: inherit;
    font-size: .92rem;
    cursor: pointer;
    margin-top: 16px;
}
button:hover, .btn:hover { filter: brightness(.94); text-decoration: none; }
.btn-secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-ok { background: var(--ok); }
.btn-sm { padding: 4px 10px; font-size: .82rem; margin-top: 0; }

/* ---------- statusy projektów ---------- */
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status-live { background: var(--ok-soft); color: var(--ok); }
.status-wip { background: var(--accent-soft); color: var(--accent); }
.status-shelf, .status-idea { background: var(--bg); color: var(--ink-soft); }

/* ---------- login ---------- */
.login-wrap { max-width: 380px; margin: 60px auto; }
.login-wrap h1 { text-align: center; }

/* ---------- narzędzia ---------- */
.tool-list { list-style: none; padding: 0; margin: 0; }
.tool-list li { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; align-items: center; gap: 14px; }
.tool-list li:last-child { border-bottom: none; }
