/* Intranet Wiśniewo – style */
:root {
    --cherry: #9f1239;
    --cherry-dark: #7a0e2c;
    --cherry-soft: #fdecf1;
    --bg: #f5f3f4;
    --card: #ffffff;
    --text: #1f1b1d;
    --muted: #6d6569;
    --border: #e8e1e4;
    --ok: #15803d;
    --ok-bg: #e7f6ec;
    --err: #b42318;
    --err-bg: #fdeceb;
    --info: #1d4e89;
    --info-bg: #eaf2fb;
    --warn: #8a5a00;
    --warn-bg: #fff4dc;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(31, 27, 29, .04), 0 6px 20px rgba(31, 27, 29, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--cherry); }
a:hover { color: var(--cherry-dark); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; line-height: 1.25; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.08rem; margin: 0; }
code { font-family: ui-monospace, Consolas, "Courier New", monospace; }

/* ---------- Pasek górny ---------- */
.topbar { background: var(--cherry); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.topbar-inner {
    max-width: 1200px; margin: 0 auto; padding: .7rem 1.25rem;
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: .45rem; }
.brand:hover { color: #fff; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav a {
    color: #fff; text-decoration: none; padding: .4rem .75rem; border-radius: 8px; opacity: .88;
    display: inline-flex; align-items: center;
}
.nav a:hover, .nav a.active { opacity: 1; background: rgba(255,255,255,.16); color: #fff; }
.pill {
    background: #fff; color: var(--cherry); border-radius: 999px; padding: 0 .45rem;
    font-size: .75rem; font-weight: 700; margin-left: .4rem; line-height: 1.5;
}
.user-box { display: flex; align-items: center; gap: .75rem; }
.user-box form { margin: 0; }
.user-name { font-size: .92rem; opacity: .92; }
.logout-btn {
    background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px; padding: .3rem .8rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.logout-btn:hover { background: rgba(255,255,255,.26); }

/* ---------- Układ ---------- */
.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 1.75rem 1.25rem; flex: 1; }
.narrow { max-width: 760px; margin: 0 auto; }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.35rem 1.5rem;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h1, .section-head h2 { margin: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 .9rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 1rem 2rem; }

/* ---------- Komunikaty ---------- */
.alert { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #c4e8d0; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #f6cfcb; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #cfe0f5; }
.big-code {
    display: inline-block; margin-left: .4rem; padding: .15rem .6rem; background: #fff;
    border: 1px dashed currentColor; border-radius: 6px; font-size: 1.15rem; letter-spacing: .05em;
    user-select: all;
}

/* ---------- Formularze ---------- */
.form label { display: block; font-weight: 600; margin: .9rem 0 .3rem; font-size: .95rem; }
.form input[type=text], .form input[type=password], .form textarea, select {
    width: 100%; padding: .65rem .8rem; border: 1px solid #d6cdd1; border-radius: 9px;
    font: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
}
select { width: auto; padding: .35rem .5rem; font-size: .9rem; }
.form textarea { resize: vertical; min-height: 180px; }
.form input:focus, .form textarea:focus, select:focus {
    outline: none; border-color: var(--cherry); box-shadow: 0 0 0 3px rgba(159, 18, 57, .15);
}
.form .checkbox { display: flex; gap: .55rem; align-items: center; font-weight: 500; margin-top: 1.1rem; cursor: pointer; }
.form .checkbox input { width: 1.05rem; height: 1.05rem; accent-color: var(--cherry); }
.form-actions { display: flex; gap: .6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.btn {
    display: inline-block; background: var(--cherry); color: #fff; border: 1px solid var(--cherry);
    border-radius: 9px; padding: .6rem 1.15rem; font: inherit; font-weight: 600; cursor: pointer;
    text-decoration: none; text-align: center; transition: background .15s;
}
.btn:hover { background: var(--cherry-dark); color: #fff; }
.btn-block { width: 100%; margin-top: 1.25rem; padding: .75rem; }
.btn-secondary { background: #fff; color: var(--text); border-color: #d6cdd1; }
.btn-secondary:hover { background: #f4eff1; color: var(--text); }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-ok:hover { background: #106330; }
.btn-danger { background: #fff; color: var(--err); border-color: #f0b8b3; }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-small { padding: .3rem .65rem; font-size: .85rem; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--cherry); cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--err); }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }

/* ---------- Logowanie / rejestracja ---------- */
.auth-page .container { display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; }
.auth-page { background: radial-gradient(1200px 500px at 50% -10%, #f9d9e3 0%, var(--bg) 60%); }
.auth-wrap { width: 100%; max-width: 460px; }
.auth-brand { text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--cherry); margin-bottom: 1rem; }
.auth-card h1 { text-align: center; }
.auth-switch { text-align: center; margin: 1.25rem 0 0; }
.notice {
    display: flex; gap: .75rem; background: var(--cherry-soft); border: 1px solid #f5c9d6;
    border-radius: 10px; padding: .85rem 1rem; font-size: .9rem; margin-bottom: 1rem; line-height: 1.5;
}
.notice-icon { font-size: 1.4rem; line-height: 1.2; }

/* ---------- Strona główna ---------- */
.greeting h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.widget { display: flex; flex-direction: column; min-height: 190px; }
.widget-title { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .6rem; }
.widget-foot { color: var(--muted); font-size: .88rem; margin-top: auto; padding-top: .7rem; }
.clock-time, .countdown { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.01em; }
.clock-date { color: var(--muted); margin-top: .35rem; font-size: 1.02rem; }
.clock-date::first-letter { text-transform: uppercase; }
.countdown { color: var(--cherry); }
.work.state-off .countdown { color: var(--ok); font-size: 2.2rem; }
.work.state-before .countdown { color: var(--info); }
.progress { height: 10px; background: #f0e8eb; border-radius: 999px; overflow: hidden; margin-top: .9rem; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #e11d48, var(--cherry)); border-radius: 999px; transition: width .8s ease; }
.work.state-off .progress, .work.state-before .progress { display: none; }
.weather-main { display: flex; align-items: center; gap: .75rem; }
.weather-icon { font-size: 3rem; line-height: 1; }
.weather-temp { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.weather-desc { font-weight: 600; margin-top: .35rem; }

/* ---------- Ogłoszenia ---------- */
.announcement { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.announcement:first-of-type { border-top: 0; padding-top: .25rem; }
.announcement.pinned {
    background: var(--cherry-soft); border: 1px solid #f5c9d6; border-left: 4px solid var(--cherry);
    border-radius: 10px; padding: 1rem 1.15rem; margin-bottom: .75rem;
}
.announcement.pinned + .announcement:not(.pinned) { border-top: 0; }
.announcement-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .45rem; }
.announcement-body { white-space: normal; overflow-wrap: anywhere; }
.announcement-foot {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    color: var(--muted); font-size: .85rem; margin-top: .6rem;
}
.announcement-actions { display: inline-flex; gap: .9rem; align-items: center; }
.badge { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge-pin { background: #fff; color: var(--cherry); border: 1px solid #f0b4c5; }
.badge-new { background: var(--ok-bg); color: var(--ok); }
.empty { padding: 1rem 0; }

/* ---------- Tabela użytkowników ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .6rem .6rem; border-bottom: 2px solid var(--border); }
.table td { padding: .65rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.row-inactive td { background: #fffaf0; }
.table .actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.status { font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-wait { background: var(--warn-bg); color: var(--warn); }
.status-off { background: #eee; color: #555; }

/* ---------- Moje konto ---------- */
.details { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; }

/* ---------- Węższe ekrany ---------- */
@media (max-width: 900px) {
    .topbar-inner { gap: .5rem 1rem; }
    .user-box { margin-left: auto; }
    .nav { order: 3; flex-basis: 100%; margin: 0 -.75rem; }
}

/* ---------- Telefony ---------- */
@media (max-width: 640px) {
    .container { padding: 1.1rem .8rem; }
    .card { padding: 1.1rem 1rem; }
    .clock-time, .countdown, .weather-temp { font-size: 2.4rem; }
    .user-box { width: 100%; justify-content: space-between; }
    .greeting h1 { font-size: 1.4rem; }
}
