/* ETERNOS — ciepła, "stacyjna" paleta: rdzawy pomarańcz + piaskowe tła. */

:root {
    --ink: #2b211b;
    --ink-soft: #6b5d52;
    --surface: #fffaf5;
    --bg: #f6efe7;
    --border: #e3d5c5;
    --primary: #c1440e;
    --primary-dark: #93330a;
    --primary-soft: #fbe4d3;
    --amber: #d68910;
    --amber-soft: #fbf0d9;
    --success-bg: #eaf6ea;
    --success-text: #2e7d32;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px 30px;
    flex: 1 0 auto;
    box-sizing: border-box;
}

h1, h2 {
    color: var(--primary-dark);
    font-weight: 600;
}

h1 { font-size: 20px; }
h2 {
    font-size: 17px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
    margin: 24px 0 14px;
}

/* Karty / kontenery sekcji */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(43, 33, 27, 0.05);
}

/* Tabele danych */
table {
    border-collapse: collapse;
    width: 100%;
    background: var(--surface);
}
table.data {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data th,
table.data td {
    border-bottom: 1px solid var(--border);
    padding: 9px 12px;
    text-align: left;
    vertical-align: middle;
}
table.data thead th,
table.data tr.head td {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border);
}
table.data tbody tr:hover td { background: #fdf6ef; }
table.data tr:last-child td { border-bottom: none; }

/* Formularze */
.form-table td { padding: 8px 10px; }
.form-table td.label {
    color: var(--ink-soft);
    font-weight: 600;
    white-space: nowrap;
    width: 180px;
}
input[type="text"], textarea, select {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
}
input[type="text"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Przyciski */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

/* Okrągłe przyciski-ikony na wiersz (podgląd / edycja) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.view:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.icon-btn.edit:hover { background: var(--amber-soft); border-color: var(--amber); color: #8a5f1c; }

.row-actions { display: flex; gap: 6px; }

/* Komunikaty */
.alert {
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #b9e2c2; }

/* Górny pasek nawigacji (includes/header.php) */
.main-nav {
    background: var(--primary-dark);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.nav-greeting {
    color: #fff;
    opacity: 0.9;
    font-size: 13px;
    white-space: nowrap;
}
.nav-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}
.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.main-nav a:hover { background: rgba(255,255,255,0.15); }
.main-nav a img { width: 40px; height: 40px; }
.main-nav a.logout { margin-left: auto; }

/* Stopka - zawsze przyklejona do dołu, nawet przy krótkiej zawartości strony */
.foot {
    flex-shrink: 0;
    text-align: center;
    color: var(--ink-soft);
    font-size: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* Karta logowania */
.login-wrap {
    max-width: 380px;
    margin: 70px auto;
    text-align: center;
}
.login-wrap h2 { border-left: none; padding-left: 0; }
.login-wrap img { max-width: 100%; border-radius: var(--radius); margin: 14px 0; }
.login-wrap .card { text-align: left; }
.login-wrap .form-table td.label { width: 110px; }
.login-wrap input[type="text"], .login-wrap input[type="password"] {
    width: 100%;
}
.alert-error { background: #fbe9e5; color: #a13a2c; border: 1px solid #f0bdb3; }