/* =====================================================================
   Pracownia Jubilerska - system designu 2.0
   Grafit + szampanskie zloto na cieplej bieli. Nowoczesny, dotykowy,
   mobile / tablet first. Spojne ikony liniowe (SVG, currentColor).
   ===================================================================== */
:root {
    /* Akcent - zloto */
    --gold:    #b3892f;
    --gold-d:  #8a6a20;
    --gold-l:  #e4cf9c;
    --gold-bg: #f8f1df;

    /* Grafit / tekst */
    --ink:     #1c1a16;
    --ink-2:   #4b463d;
    --ink-soft:#8b8578;

    /* Powierzchnie */
    --bg:      #f3f1ea;
    --bg-2:    #eae6db;
    --card:    #ffffff;
    --line:    #ebe6db;
    --line-2:  #ddd6c7;

    /* Semantyczne */
    --ok:   #2f7d4f; --ok-bg:  #e7f3ec;
    --warn: #b7791f; --warn-bg:#fbf1da;
    --bad:  #c0433a; --bad-bg: #fbe9e7;
    --blue: #2f6dbd; --blue-bg:#e8effa;

    /* Cienie - neutralne, miekkie, precyzyjne */
    --sh-xs: 0 1px 2px rgba(28,26,22,.05);
    --sh-sm: 0 2px 6px rgba(28,26,22,.06), 0 1px 2px rgba(28,26,22,.04);
    --sh:    0 12px 30px rgba(28,26,22,.09);
    --sh-lg: 0 26px 60px rgba(20,18,12,.22);
    --sh-gold: 0 8px 20px rgba(160,120,40,.26);

    /* Grafitowy gradient (naglowek, przyciski sec, zakladka aktywna) */
    --graphite: linear-gradient(180deg, #34312a, #201e19);

    /* Ksztalt */
    --r-sm: 12px;
    --r:    16px;
    --r-lg: 22px;
    --tap:  54px;

    /* Typografia */
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    font-size: 16.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(1200px 760px at 100% -12%, rgba(179,137,47,.09), transparent 55%),
        radial-gradient(900px 620px at -12% 112%, rgba(47,109,189,.05), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

/* Ikony liniowe */
.ic { display: inline-block; vertical-align: -0.16em; flex: none; }

h1, h2, h3 { font-family: var(--serif); letter-spacing: .1px; color: var(--ink); }
h1 { font-size: 29px; margin: 4px 0 6px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 21px; margin: 24px 0 14px; font-weight: 700; }
h3 { font-size: 18px; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title .ic { color: var(--gold-d); }
.subtitle { color: var(--ink-soft); margin: 0 0 22px; font-size: 16.5px; }

a { color: var(--gold-d); }

/* =====================================================================
   NAGLOWEK / NAWIGACJA
   ===================================================================== */
header.top {
    background: var(--graphite);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    padding-top: calc(12px + env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: inset 0 -1px 0 rgba(228,207,156,.16), 0 6px 24px rgba(18,15,8,.24);
}
header.top .logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--serif); font-size: 22px; font-weight: 700;
    color: #fff; letter-spacing: .3px; text-decoration: none;
}
header.top .logo-mark {
    width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px; color: #241f12;
    background: linear-gradient(150deg, var(--gold-l), var(--gold) 55%, var(--gold-d));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 12px rgba(160,120,40,.4);
}
header.top .logo b { font-weight: 700; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
header.top nav a {
    color: #d6cfbf; text-decoration: none; padding: 9px 14px;
    border-radius: 11px; font-size: 15px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background .16s, color .16s;
}
header.top nav a .nav-ic { display: inline-flex; opacity: .85; }
header.top nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
header.top nav a:hover .nav-ic { opacity: 1; }
header.top nav a.active {
    background: linear-gradient(180deg, var(--gold), var(--gold-d));
    color: #fff; box-shadow: var(--sh-gold);
}
header.top nav a.active .nav-ic { opacity: 1; }

header.top .user-box { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.user-chip {
    display: flex; align-items: center; gap: 9px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(228,207,156,.18);
    border-radius: 999px; padding: 4px 14px 4px 4px; color: #fff; font-weight: 600; font-size: 14.5px;
}
.user-chip-name { white-space: nowrap; }
.logout-btn {
    width: 42px; height: 42px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.10);
    color: #fff; text-decoration: none; transition: background .16s, border-color .16s;
}
.logout-btn:hover { background: var(--bad); border-color: var(--bad); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 26px 20px 80px; }
.backbar { margin-bottom: 16px; }
.backbar a { color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 15.5px; display: inline-flex; align-items: center; gap: 7px; }
.backbar a:hover { color: var(--gold-d); }

/* =====================================================================
   EKRAN STARTOWY
   ===================================================================== */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.tile {
    position: relative; display: flex; align-items: center; gap: 18px;
    background: var(--card); border-radius: var(--r-lg);
    padding: 26px; text-decoration: none; color: var(--ink);
    box-shadow: var(--sh-sm); border: 1px solid var(--line); overflow: hidden;
    transition: transform .14s ease, box-shadow .22s, border-color .22s;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--sh); border-color: var(--gold-l); }
.tile:active { transform: translateY(-1px) scale(.995); }
.tile-ic {
    width: 66px; height: 66px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 18px; color: var(--gold-d);
    background: linear-gradient(160deg, #fdf7e7, var(--gold-bg));
    border: 1px solid var(--gold-l);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.tile .t { font-family: var(--serif); font-size: 23px; font-weight: 700; display: block; }
.tile .s { color: var(--ink-soft); margin-top: 4px; font-size: 15px; display: block; }
.tile-go { margin-left: auto; color: var(--gold-d); opacity: .5; transition: opacity .2s, transform .2s; }
.tile:hover .tile-go { opacity: 1; transform: translateX(3px); }

.quick { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 16px; }
.quick a {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    padding: 20px 14px; text-decoration: none; color: var(--ink); text-align: center;
    font-weight: 700; font-size: 15.5px; box-shadow: var(--sh-xs);
    transition: transform .14s, border-color .22s, box-shadow .22s;
}
.quick a:hover { border-color: var(--gold-l); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.quick .ico { display: block; margin: 0 auto 8px; color: var(--gold-d); }

/* =====================================================================
   KARTY / FORMULARZE
   ===================================================================== */
.card {
    background: var(--card); border-radius: var(--r); padding: 24px;
    box-shadow: var(--sh-sm); margin-bottom: 18px; border: 1px solid var(--line);
}
.card h2:first-child, .card h2:nth-child(2) { margin-top: 0; }
.card-h2-ic { display: flex; align-items: center; gap: 10px; }
.card-h2-ic .ic { color: var(--gold-d); }
.card.step { position: relative; padding-left: 26px; }
.card.step::before {
    content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px;
    border-radius: 4px; background: linear-gradient(180deg, var(--gold), var(--gold-d));
}
.card.step > h2 { display: flex; align-items: center; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #fff;
    font-family: var(--sans); font-weight: 800; margin-right: 12px; font-size: 16px;
    box-shadow: var(--sh-gold);
}

label { display: block; font-weight: 700; margin: 16px 0 7px; font-size: 15px; color: var(--ink-2); }
input[type=text], input[type=tel], input[type=number], input[type=date],
input[type=password], textarea, select {
    width: 100%; padding: 14px 15px; font-size: 16.5px;
    border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: #fff;
    font-family: inherit; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: #aaa295; }
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a6a20' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 15px center; padding-right: 44px;
    cursor: pointer;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--gold); background: #fff;
    box-shadow: 0 0 0 4px rgba(179,137,47,.16);
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.check { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-weight: 700; cursor: pointer; color: var(--ink); }
.check input { width: 24px; height: 24px; accent-color: var(--gold-d); flex: none; }
.big-check { font-size: 16px; padding: 6px 0; }

.cap-note { font-size: 14.5px; color: var(--ink-soft); margin-top: 6px; }
.cap-note.bad { color: var(--bad); font-weight: 800; }

/* Pozycje produktow */
.item {
    border: 1.5px solid var(--line); border-radius: var(--r); padding: 20px;
    margin-bottom: 16px; background: #fcfaf5; position: relative;
}
.item .del { position: absolute; top: 14px; right: 14px; min-height: 40px; width: 40px; padding: 0; }
.field-na .na-toggle { font-weight: 600; font-size: 13.5px; color: var(--ink-soft); margin: 8px 0 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.field-na .na-toggle input { width: 18px; height: 18px; accent-color: var(--gold-d); }
input.off { background: #efeadf; color: #9a948a; }
.ubytek-box { margin-top: 14px; background: #fff; border: 1.5px dashed var(--line-2); border-radius: var(--r-sm); padding: 14px; }
.ubytek-pct { margin-top: 10px; max-width: 220px; }
.pct-input { position: relative; }
.pct-input input { padding-right: 42px; }
.pct-sign { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--ink-soft); }

/* =====================================================================
   PRZYCISKI
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #fff; border: none;
    min-height: var(--tap); padding: 0 22px; font-size: 16.5px; border-radius: 13px;
    cursor: pointer; font-weight: 700; text-decoration: none; line-height: 1.1;
    font-family: var(--sans); box-shadow: var(--sh-gold);
    transition: transform .08s ease, box-shadow .18s, filter .18s;
}
.btn:hover { filter: brightness(1.04); box-shadow: var(--sh); }
.btn:active { transform: translateY(2px); box-shadow: var(--sh-sm); }
.btn .ic { opacity: .95; }
.btn.sec { background: var(--graphite); box-shadow: var(--sh-sm); }
.btn.sec:hover { filter: brightness(1.1); }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: var(--sh-xs); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-d); filter: none; box-shadow: var(--sh-xs); }
.btn.danger { background: linear-gradient(180deg, #d05548, #b23a2f); box-shadow: 0 8px 18px rgba(180,60,45,.24); }
.btn.lg { width: 100%; min-height: 62px; font-size: 19px; border-radius: 15px; }
.btn.sm { min-height: 44px; padding: 0 15px; font-size: 14.5px; border-radius: 11px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; align-items: center; }

/* =====================================================================
   TABELE
   ===================================================================== */
.table-card, .card[style*="overflow"] { border-radius: var(--r); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-sm); }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15.5px; }
th { background: #faf6ec; font-weight: 800; color: #7a5f22; font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fbf8f0; }
tr:last-child td { border-bottom: none; }

/* Plakietki / pigulki */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.badge.naprawa { background: var(--blue-bg); color: var(--blue); }
.badge.wyrob { background: var(--warn-bg); color: #b06a00; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 800; }
.pill .ic { flex: none; }

/* =====================================================================
   ZAKLADKI
   ===================================================================== */
.tabs { display: flex; gap: 8px; margin: 6px 0 22px; flex-wrap: wrap; }
.tabs a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 20px; border-radius: 999px; text-decoration: none;
    background: var(--card); color: var(--ink-soft); font-weight: 700; font-size: 15px;
    border: 1.5px solid var(--line); box-shadow: var(--sh-xs); transition: all .16s;
}
.tabs a:hover { border-color: var(--gold-l); color: var(--gold-d); }
.tabs a.active {
    background: var(--graphite); color: #fff; border-color: transparent; box-shadow: var(--sh-sm);
}

/* Wyszukiwarka */
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-field { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search-ic { position: absolute; left: 15px; color: var(--ink-soft); pointer-events: none; display: inline-flex; }
.search-field input { padding-left: 44px; }

/* =====================================================================
   STATUSY (przyciski jeden klik)
   ===================================================================== */
.status-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.status-pick-form { margin: 0; }
.status-btn {
    display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
    min-height: 54px; padding: 0 20px; font-size: 16px; font-weight: 800;
    border: 2px solid; border-radius: 13px; background: #fff; font-family: var(--sans);
    transition: transform .08s, box-shadow .15s, filter .15s;
}
.status-btn .si { display: inline-flex; }
.status-btn .chk { display: inline-flex; margin-left: 2px; }
.status-btn:hover { box-shadow: var(--sh-sm); filter: brightness(1.02); }
.status-btn:active { transform: translateY(1px); }

.quick-status { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick-status form { margin: 0; }
.mini-btn {
    display: inline-flex; align-items: center; gap: 5px;
    min-height: 36px; padding: 0 11px; font-size: 12.5px; border-radius: 9px;
    border: 1.5px solid var(--line-2); background: #fff; font-weight: 800; cursor: pointer; color: var(--ink);
    transition: border-color .15s, background .15s;
}
.mini-btn:hover { border-color: var(--gold); background: #fffaf0; }

/* Osoba przypisana */
.assignee {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--ink);
    background: var(--gold-bg); border: 1px solid var(--line-2);
    padding: 3px 11px 3px 4px; border-radius: 999px; white-space: nowrap;
}
.assignee.none { color: var(--ink-soft); background: #f1eee7; border-style: dashed; padding-left: 10px; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; font-weight: 800; flex: none;
    line-height: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.28); vertical-align: middle;
}

/* =====================================================================
   TERMINARZ - KALENDARZ
   ===================================================================== */
.pl-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pl-monthnav { display: flex; align-items: center; gap: 10px; }
.pl-nav {
    width: 48px; height: 48px; flex: none; border-radius: 13px;
    border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink);
    font-size: 24px; font-weight: 800; cursor: pointer; text-decoration: none;
    display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-xs);
    transition: border-color .15s, color .15s;
}
.pl-nav:hover { border-color: var(--gold); color: var(--gold-d); }
.pl-month {
    font-family: var(--serif); font-size: 23px; font-weight: 700; min-width: 220px; text-align: center;
    text-transform: capitalize;
}
.pl-today-btn { margin-left: auto; }
.pl-legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; margin: 0 2px 16px; }
.pl-legend span { display: inline-flex; align-items: center; gap: 7px; }
.pl-legend i { width: 13px; height: 13px; border-radius: 5px; display: inline-block; }

.pl-cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 14px; }
.pl-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 8px; }
.pl-dow span { text-align: center; font-weight: 800; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; padding: 4px 0; }
.pl-dow span.we { color: var(--bad); opacity: .65; }
.pl-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }

.pl-day {
    position: relative; display: flex; flex-direction: column; align-items: stretch;
    min-height: 94px; padding: 8px; border: 1.5px solid var(--line); border-radius: 13px;
    background: #fffdf9; cursor: pointer; text-align: left; font-family: inherit; color: var(--ink);
    transition: border-color .12s, box-shadow .12s, transform .08s, background .12s;
    overflow: hidden;
}
.pl-day:hover { border-color: var(--gold-l); box-shadow: var(--sh-sm); }
.pl-day:active { transform: scale(.98); }
.pl-day.is-out { background: transparent; border-color: transparent; cursor: default; }
.pl-day.is-out .pl-dnum { color: #c8c1b3; }
.pl-day.is-weekend { background: #f6f2e9; }
.pl-day.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.pl-day.is-selected { border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(179,137,47,.28), var(--sh-sm); background: #fffaef; }
.pl-dnum { font-weight: 800; font-size: 15px; line-height: 1; }
.pl-day.is-today .pl-dnum {
    color: #fff; background: linear-gradient(180deg, var(--gold), var(--gold-d));
    width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    align-self: flex-start;
}

.pl-dots { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.pl-body { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.pl-chip {
    font-size: 11px; font-weight: 700; line-height: 1.25; padding: 3px 7px; border-radius: 7px;
    background: var(--blue-bg); color: var(--blue);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-chip.wyrob { background: var(--warn-bg); color: #b06a00; }
.pl-chip.done { background: var(--ok-bg); color: var(--ok); }
.pl-more { font-size: 11px; font-weight: 800; color: var(--ink-soft); padding: 0 2px; }
.pl-count { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 800; color: var(--ink); background: var(--gold-bg); border: 1px solid var(--line-2); padding: 1px 8px; border-radius: 999px; }

.pl-cap { margin-top: 6px; }
.pl-cap-bar { height: 6px; border-radius: 6px; background: #ece5d6; overflow: hidden; }
.pl-cap-bar > i { display: block; height: 100%; width: var(--fill,0%); background: linear-gradient(90deg, var(--gold), var(--gold-d)); }
.pl-cap.full .pl-cap-bar > i { background: linear-gradient(90deg, #d6695c, var(--bad)); }
.pl-cap-txt { font-size: 11px; font-weight: 800; margin-top: 3px; color: var(--ink-soft); }
.pl-cap.full .pl-cap-txt { color: var(--bad); }

/* Panel wybranego dnia */
.pl-panel { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; }
.pl-panel-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: linear-gradient(180deg, #fffaef, #fff); border-bottom: 1px solid var(--line); }
.pl-panel-date { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.pl-panel-date small { display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-transform: capitalize; }
.pl-panel-head .btn { margin-left: auto; }
.pl-panel-body { padding: 16px 18px 20px; }
.pl-order { display: block; text-decoration: none; color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; background: #fffdf9; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .08s; }
.pl-order:hover { border-color: var(--gold-l); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.pl-order:last-child { margin-bottom: 0; }
.pl-order-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-order-id { font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.pl-order-name { font-weight: 800; font-size: 17px; margin-top: 8px; }
.pl-order-svc { color: var(--ink-soft); margin: 4px 0 10px; font-size: 14.5px; }
.pl-order-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-empty { text-align: center; color: var(--ink-soft); padding: 34px 16px; }
.pl-empty .ico { display: block; margin: 0 auto 10px; color: var(--line-2); }

/* =====================================================================
   KALENDARZ POPUP (wybor daty w formularzu)
   ===================================================================== */
.cal-field.is-empty .cal-label { color: var(--ink-soft); font-weight: 600; }
.cal-trigger {
    width: 100%; display: flex; align-items: center; gap: 12px;
    min-height: 56px; padding: 0 15px; font-size: 16.5px; font-weight: 700;
    background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer;
    color: var(--ink); text-align: left; transition: border-color .15s, box-shadow .15s;
}
.cal-trigger:hover { border-color: var(--gold); }
.cal-ico { display: inline-flex; color: var(--gold-d); }
.cal-label { flex: 1; }
.cal-caret { color: var(--ink-soft); display: inline-flex; }

.cal-overlay { position: fixed; inset: 0; background: rgba(24,20,10,.5); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.cal-overlay.show { display: flex; animation: fade .16s ease; }
.cal-modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg); width: 100%; max-width: 440px; padding: 20px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-title { flex: 1; text-align: center; font-family: var(--serif); font-size: 21px; font-weight: 700; }
.cal-nav { width: 50px; height: 50px; border-radius: 13px; border: 1.5px solid var(--line-2); background: #fff; font-size: 24px; cursor: pointer; font-weight: 800; color: var(--ink); }
.cal-nav:hover { border-color: var(--gold); }
.cal-dows { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; margin-bottom: 6px; }
.cal-dows span { text-align: center; font-weight: 800; color: var(--ink-soft); font-size: 13px; padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.cal-empty { aspect-ratio: 1 / 1; }
.cal-day {
    aspect-ratio: 1 / 1; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 18px; color: var(--ink); padding: 2px;
}
.cal-day b { font-weight: 700; }
.cal-day small { font-size: 10.5px; font-weight: 700; color: var(--ok); line-height: 1; margin-top: 2px; }
.cal-day:hover:not(:disabled) { border-color: var(--gold); background: #fff8e9; }
.cal-day.cal-today { border-color: var(--gold); }
.cal-day.cal-sel { background: linear-gradient(180deg, var(--gold), var(--gold-d)); border-color: var(--gold-d); color: #fff; }
.cal-day.cal-sel small { color: #fff; }
.cal-day.cal-full { background: var(--bad-bg); }
.cal-day.cal-full small { color: var(--bad); }
.cal-day:disabled { opacity: .36; cursor: not-allowed; }
.cal-foot { display: flex; gap: 10px; margin-top: 14px; }
.cal-foot .btn { flex: 1; min-height: 48px; font-size: 15px; }

/* =====================================================================
   ALERTY / MODALE / FLASH
   ===================================================================== */
.overlay { position: fixed; inset: 0; background: rgba(24,20,10,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal { background: #fff; border-radius: var(--r-lg); padding: 34px; max-width: 500px; width: 100%; text-align: center; box-shadow: var(--sh-lg); animation: pop .2s ease; }
.modal .big { width: 76px; height: 76px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--gold-d); background: var(--gold-bg); border: 1px solid var(--gold-l); }
.modal h2 { margin-top: 8px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.flash {
    display: flex; align-items: center; gap: 10px;
    background: var(--ok-bg); color: var(--ok); border: 1px solid #b6ddc3;
    padding: 14px 18px; border-radius: var(--r-sm); margin-bottom: 18px; font-weight: 700; font-size: 16px;
}
.flash .ic { flex: none; }

/* Pusty stan / brak dostepu */
.empty-state { text-align: center; }
.empty-ic { width: 76px; height: 76px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--ink-soft); background: var(--bg-2); }

/* =====================================================================
   LOGOWANIE (mobile-first)
   ===================================================================== */
.auth-body {
    min-height: 100vh; min-height: 100dvh; margin: 0;
    display: flex; align-items: center; justify-content: center;
    padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    background:
        radial-gradient(900px 520px at 50% -8%, rgba(179,137,47,.30), transparent 62%),
        radial-gradient(700px 500px at 100% 110%, rgba(47,109,189,.12), transparent 60%),
        linear-gradient(170deg, #2c2921 0%, #201d17 55%, #141109 100%);
}
.auth-shell { width: 100%; max-width: 410px; min-width: 0; margin: auto; }
.auth-card {
    position: relative; background: var(--card); border-radius: 26px; padding: 40px 26px 30px;
    text-align: center; box-shadow: 0 28px 60px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.25); overflow: hidden;
}
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-l), var(--gold-d)); }
.auth-mark {
    width: 74px; height: 74px; margin: 4px auto 18px; display: flex; align-items: center; justify-content: center;
    color: #241f12; border-radius: 22px;
    background: linear-gradient(155deg, var(--gold-l), var(--gold) 45%, var(--gold-d));
    box-shadow: 0 12px 26px rgba(179,137,47,.42), inset 0 1px 0 rgba(255,255,255,.55);
}
.auth-title { font-family: var(--serif); font-size: 25px; font-weight: 700; margin: 0 0 4px; }
.auth-sub { color: var(--ink-soft); margin: 0 0 26px; font-size: 15.5px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field {
    display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 8px 0 15px;
    background: #faf6ee; border: 1.5px solid var(--line-2); border-radius: 15px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:focus-within { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(179,137,47,.16); }
.field.is-error { border-color: #e0a39c; background: #fdf4f3; }
.field-ico { display: inline-flex; color: var(--ink-soft); flex: none; }
.field:focus-within .field-ico { color: var(--gold-d); }
.field input { flex: 1; width: 100%; border: none; background: transparent; outline: none; font-size: 17px; font-weight: 600; color: var(--ink); padding: 14px 0; font-family: inherit; min-width: 0; }
.field input::placeholder { color: #a39c8e; font-weight: 600; }
.field-eye { flex: none; border: none; background: transparent; cursor: pointer; color: var(--gold-d); font-weight: 800; font-size: 14px; padding: 10px 12px; border-radius: 11px; min-height: 44px; }
.field-eye:hover { background: var(--gold-bg); }
.field-eye .eye-hide { display: none; }
.field-eye.on .eye-show { display: none; }
.field-eye.on .eye-hide { display: inline; }
.auth-btn {
    margin-top: 6px; min-height: 60px; border: none; border-radius: 15px; cursor: pointer;
    font-size: 18px; font-weight: 800; color: #fff; font-family: var(--sans);
    background: linear-gradient(160deg, var(--gold), var(--gold-d)); box-shadow: var(--sh-gold);
    transition: transform .08s ease, box-shadow .15s, filter .15s;
}
.auth-btn:hover { filter: brightness(1.05); }
.auth-btn:active { transform: translateY(2px); box-shadow: var(--sh-sm); }
.auth-error {
    display: flex; align-items: center; gap: 10px; text-align: left;
    background: var(--bad-bg); color: #b3261e; border: 1px solid #f0c2bd;
    padding: 13px 15px; border-radius: 13px; font-weight: 700; font-size: 14.5px; margin-bottom: 18px;
}
.auth-error .ic { flex: none; }
.auth-error .ae-ico { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #d6453a; color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.auth-foot { text-align: center; color: rgba(255,255,255,.42); margin: 22px 0 0; font-weight: 700; letter-spacing: 2px; font-size: 13px; text-transform: uppercase; }

/* =====================================================================
   PRACOWNICY
   ===================================================================== */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.user-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--sh-sm); transition: box-shadow .15s, transform .1s; }
.user-card:hover { box-shadow: var(--sh); transform: translateY(-2px); }
.user-card.off { opacity: .62; background: #faf7f0; }
.user-top { display: flex; align-items: center; gap: 14px; }
.user-name { font-size: 18px; font-weight: 800; }
.user-name .you { font-size: 11.5px; font-weight: 800; color: var(--gold-d); background: var(--gold-bg); border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: middle; }
.user-meta { margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }
.role-tag { font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 3px 11px; }
.role-tag.adm { background: var(--gold-bg); color: var(--gold-d); }
.role-tag.wrk { background: var(--blue-bg); color: var(--blue); }
.role-tag.off { background: var(--bad-bg); color: var(--bad); }
.user-stat { margin-top: 14px; color: var(--ink-soft); font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.user-edit { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.user-edit summary { cursor: pointer; font-weight: 800; color: var(--ink-soft); list-style: none; padding: 8px 0; font-size: 14.5px; user-select: none; display: flex; align-items: center; gap: 8px; }
.user-edit summary::-webkit-details-marker { display: none; }
.user-edit summary:hover { color: var(--gold-d); }
.user-edit[open] summary { color: var(--ink); }
.user-edit label { margin: 12px 0 6px; font-size: 14.5px; }
.user-edit input, .user-edit select { padding: 12px; font-size: 15.5px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.user-actions form { margin: 0; }
.user-actions .btn { min-height: 46px; padding: 0 15px; font-size: 14.5px; }
.pw-form { display: flex; gap: 8px; flex: 1 1 100%; }
.pw-form input { flex: 1; padding: 12px; font-size: 15px; }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.color-pick .swatch { width: 42px; height: 42px; border-radius: 12px; cursor: pointer; position: relative; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), var(--sh-xs); display: flex; align-items: center; justify-content: center; }
.color-pick .swatch input { position: absolute; opacity: 0; pointer-events: none; }
.color-pick .swatch .dot { color: #fff; opacity: 0; display: inline-flex; }
.color-pick .swatch input:checked + .dot { opacity: 1; }
.color-pick .swatch:has(input:checked) { outline: 3px solid var(--ink); outline-offset: 2px; }

/* =====================================================================
   RAPORT
   ===================================================================== */
#top { scroll-margin-top: 84px; }
.rep-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.rep-card { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh-sm); transition: transform .14s, border-color .2s, box-shadow .2s; border-left: 4px solid var(--gold); }
.rep-card:hover { transform: translateY(-2px); border-color: var(--gold-l); box-shadow: var(--sh); }
.rep-card-title { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.rep-card-dates { color: var(--ink-soft); font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.rep-card-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rep-stat { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 4px 11px; }
.rep-stat.nap { background: var(--blue-bg); color: var(--blue); }
.rep-stat.wyr { background: var(--warn-bg); color: #b06a00; }
.rep-card-total { margin-top: 12px; font-size: 22px; font-weight: 800; color: var(--gold-d); font-family: var(--serif); }

.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 28px; }
.report h2 { scroll-margin-top: 90px; border-bottom: 2px solid var(--gold); padding-bottom: 8px; margin-top: 32px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report h2:first-of-type { margin-top: 18px; }
.report h3.cat { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; color: var(--ink); font-size: 17px; }
.report h3.cat .ic { color: var(--gold-d); }
.report .table-card { margin-bottom: 4px; }
.day-title { margin: 14px 0 6px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.day-title .cap-tag { font-size: 11.5px; font-weight: 800; background: var(--ok-bg); color: var(--ok); padding: 2px 9px; border-radius: 999px; }
.day-title.full-day .cap-tag { background: var(--bad-bg); color: var(--bad); }
.day-empty { color: var(--ink-soft); font-size: 13.5px; padding: 4px 2px 8px; }
.subtotal { text-align: right; font-weight: 800; margin-top: 8px; color: var(--ink-2); }
.week-total { text-align: right; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ink); border-top: 2px solid var(--gold); padding-top: 10px; margin-top: 12px; }
.rep-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; color: var(--ink-soft); text-decoration: none; font-size: 13.5px; }
.rep-back:hover { color: var(--gold-d); }

/* =====================================================================
   RESPONSYWNOSC
   ===================================================================== */
@media (min-width: 641px) { .pl-dots { display: none; } }
@media (max-width: 920px) {
    .row-3 { grid-template-columns: 1fr; }
    .pl-month { min-width: 0; flex: 1; font-size: 21px; }
    .pl-today-btn { width: 100%; order: 3; margin-left: 0; }
    .pl-toolbar { gap: 10px; }
    .pl-monthnav { flex: 1; }
}
@media (max-width: 640px) {
    body { font-size: 16px; }
    .tiles { grid-template-columns: 1fr; }
    .row, .row-3 { grid-template-columns: 1fr; }
    .quick { grid-template-columns: 1fr; }
    .rep-nav { grid-template-columns: 1fr; }
    header.top { flex-wrap: wrap; padding: 11px 14px; padding-top: calc(11px + env(safe-area-inset-top)); gap: 10px; }
    header.top .logo { font-size: 20px; }
    header.top nav { order: 3; width: 100%; justify-content: space-between; gap: 4px; margin-left: 0; }
    header.top nav a { padding: 9px 6px; font-size: 12px; flex: 1; justify-content: center; gap: 5px; flex-direction: column; }
    header.top nav a .nav-lbl { font-size: 11px; }
    header.top .user-box { margin-left: auto; }
    header.top .user-chip-name { display: none; }
    .wrap { padding: 20px 14px 64px; }
    h1 { font-size: 24px; }
    .report { padding: 16px; }

    .pl-cal { padding: 8px; border-radius: var(--r); }
    .pl-dow { gap: 4px; }
    .pl-grid { gap: 4px; }
    .pl-day { min-height: 62px; padding: 5px; border-radius: 11px; }
    .pl-dnum { font-size: 14px; }
    .pl-chip { display: none; }
    .pl-cap-txt { font-size: 10px; }
    .pl-panel-head { padding: 16px; }
    .pl-panel-body { padding: 14px; }
}

/* Kropki dnia (telefon) */
.pl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); display: inline-block; }
.pl-dot.wyrob { background: var(--warn); }
.pl-dot.done { background: var(--ok); }

/* =====================================================================
   WYDRUK
   ===================================================================== */
.print-only { display: none; }

/* =====================================================================
   DOKUMENT DO DRUKU - zlecenie jako czysta kartka, nie kopia strony.
   Klasy .doc-* renderują się tak samo na ekranie (podgląd) i na wydruku.
   ===================================================================== */
.doc {
    --doc-ink:  #1a1712;
    --doc-soft: #6f685c;
    --doc-line: #cfc7b6;
    --doc-gold: #9c7a24;
    --doc-tint: #f6f1e5;
    color: var(--doc-ink);
    background: #fff;
    font-family: var(--sans);
    line-height: 1.45;
}

.doc-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 26px;
    padding-bottom: 12px; border-bottom: 2px solid var(--doc-gold);
}
.doc-firm { font-family: var(--serif); font-size: 25px; font-weight: 700; line-height: 1.1; }
.doc-firm-sub { margin-top: 4px; font-size: 11.5px; color: var(--doc-soft); letter-spacing: .2px; }
.doc-meta { text-align: right; flex: none; }
.doc-type { font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--doc-soft); }
.doc-nr { margin-top: 1px; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.doc-copy {
    margin-top: 7px; display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1px;
    text-transform: uppercase; color: var(--doc-gold);
    border: 1px solid var(--doc-gold); border-radius: 999px; padding: 2px 11px;
}

.doc-parties {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin: 18px 0 2px;
}
.doc-field { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--doc-line); }
.doc-field .k { flex: none; min-width: 128px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--doc-soft); }
.doc-field .v { font-size: 13.5px; font-weight: 600; }

.doc-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
.doc-table th, .doc-table td { border: 1px solid var(--doc-line); padding: 8px 11px; text-align: left; vertical-align: top; }
.doc-table thead th { background: var(--doc-tint); font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--doc-soft); }
.doc-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-table .desc { font-size: 12.5px; color: var(--doc-ink); }
.doc-table .muted { color: var(--doc-soft); }
.doc-table tfoot td, .doc-table tfoot th { font-size: 13px; }
.doc-table tfoot .num { font-weight: 700; }
.doc-total th { text-align: right; background: var(--doc-tint); font-size: 13px; font-weight: 800; }
.doc-total td { background: var(--doc-tint); font-size: 15px; font-weight: 800; }

.doc-signs { display: flex; justify-content: space-between; gap: 60px; margin-top: 48px; }
.doc-sign { flex: 1; }
.doc-sign .line { display: block; border-top: 1px solid var(--doc-ink); padding-top: 6px; font-size: 11px; color: var(--doc-soft); text-align: center; }

.doc-note { margin: 20px 0 0; padding-left: 11px; border-left: 3px solid var(--doc-gold); font-size: 10.5px; color: var(--doc-soft); line-height: 1.5; }

.doc-foot { margin-top: 18px; padding-top: 9px; border-top: 1px solid var(--doc-line); display: flex; justify-content: space-between; font-size: 10px; color: var(--doc-soft); }

/* ---------- Raport tygodniowy jako dokument (te same klasy .doc-*) ---------- */
.rep-week { margin-top: 26px; }
.rep-week + .rep-week { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--doc-line); }
.rep-week-title { font-family: var(--serif); font-size: 19px; font-weight: 700; margin: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rep-week-title .range { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--doc-soft); letter-spacing: .3px; }
.rep-cat { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; color: var(--doc-gold); }
.rep-cat::after { content: ""; flex: 1; height: 1px; background: var(--doc-line); }
.rep-day { margin-bottom: 12px; }
.rep-day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 11px; background: var(--doc-tint); border: 1px solid var(--doc-line); border-bottom: 0; font-size: 12px; font-weight: 700; }
.rep-day-head.full { color: #8a2f2a; }
.rep-cap { font-size: 10.5px; font-weight: 800; letter-spacing: .4px; background: #fff; border: 1px solid var(--doc-line); border-radius: 999px; padding: 1px 10px; color: var(--doc-soft); }
.rep-day-head.full .rep-cap { color: #8a2f2a; border-color: #d9b2ad; }
.rep-table { margin-top: 0 !important; }
.rep-table thead th { background: #fbf8f0; }
.rep-empty { padding: 8px 11px; border: 1px solid var(--doc-line); border-top: 0; font-size: 11.5px; color: var(--doc-soft); font-style: italic; }
.rep-subtotal { margin-top: 9px; text-align: right; font-size: 12.5px; font-weight: 700; }
.rep-subtotal span { color: var(--doc-soft); font-weight: 600; }
.rep-weektotal { margin-top: 14px; padding: 10px 15px; background: var(--doc-ink); color: #fff; border-radius: 9px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 800; letter-spacing: .3px; }

/* Pasek nawigacji tygodni (tylko ekran) */
.weeknav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.weeknav .btn { padding: 0 16px; height: 46px; font-size: 15px; }
.weeknav .btn.round { width: 46px; padding: 0; }

/* Wybierak tygodnia - mały interaktywny kalendarz */
.weekpick { position: relative; }
.weekpick-btn { display: inline-flex; align-items: center; gap: 9px; min-width: 200px; justify-content: center; font-weight: 800; }
.weekpick-btn .wp-caret { transition: transform .15s; }
.weekpick.open .weekpick-btn .wp-caret { transform: rotate(180deg); }
.weekpick-pop {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    z-index: 60; width: 312px; background: #fff; border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--sh-lg); padding: 14px; animation: pop .16s ease;
}
.weekpick-pop[hidden] { display: none; }
.wp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wp-title { font-weight: 800; font-size: 15px; }
.wp-nav { width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid var(--line-2); background: #fff; font-size: 20px; font-weight: 800; cursor: pointer; color: var(--ink); }
.wp-nav:hover { border-color: var(--gold); color: var(--gold-d); }
.wp-dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 5px; }
.wp-dows span { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.wp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.wp-empty { aspect-ratio: 1 / 1; }
.wp-day {
    aspect-ratio: 1 / 1; border: 0; background: transparent; border-radius: 0;
    font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.wp-day:first-child, .wp-day.wk-start { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.wp-day:last-child, .wp-day.wk-end { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.wp-day.wp-inweek { background: var(--gold-bg); }
.wp-day.wp-hover { background: var(--gold-l); color: var(--ink); }
.wp-day.wp-today { box-shadow: inset 0 0 0 2px var(--gold); font-weight: 800; }
.wp-day.wp-other { color: var(--ink-soft); opacity: .55; }
.wp-foot { margin-top: 12px; }
.wp-foot .btn { width: 100%; height: 44px; }

/* Podgląd na ekranie - kartka na biurku */
@media screen {
    .print-area { max-width: 900px; margin: 6px auto 0; }
    .doc {
        max-width: 880px; margin: 0 auto 26px;
        padding: 36px 40px;
        border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh);
    }
    .doc-table { display: block; overflow-x: auto; }
}
@media screen and (max-width: 640px) {
    .doc { padding: 20px 16px; border-radius: 12px; }
    .doc-parties { grid-template-columns: 1fr; gap: 0; }
    .doc-head { gap: 14px; }
    .doc-firm { font-size: 21px; }
}

/* =============================== DRUK =============================== */
@page { size: A4; margin: 15mm 16mm; }

@media print {
    header.top, nav, .no-print, .actions, .cal-overlay, .backbar, .weeknav { display: none !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    html, body { background: #fff !important; }
    body { font-size: 12px; }
    .wrap { max-width: none; margin: 0; padding: 0; }
    .print-only { display: block; }

    /* Wspólnie: dokument bez cieni i ramek ekranu */
    .print-area { max-width: none; margin: 0; }
    .doc { max-width: none; padding: 0; margin: 0; border: 0; box-shadow: none; }

    /* Zlecenie: jeden egzemplarz na stronę */
    .print-area .doc { page-break-after: always; break-after: page; }
    .print-area .doc:last-child { page-break-after: auto; break-after: auto; }
    .doc-table { page-break-inside: auto; }
    .doc-table tr, .doc-signs, .doc-parties { page-break-inside: avoid; }

    /* Raport: każdy tydzień od nowej strony, bloki nierozrywane */
    .rep-week + .rep-week { page-break-before: always; break-before: page; }
    .rep-day, .rep-day-head, .rep-subtotal, .rep-weektotal { page-break-inside: avoid; }
    .rep-cat { page-break-after: avoid; }
}

/* ---------- Paginacja listy zleceń ---------- */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin: 18px 0 8px;
}
.pager-info { color: var(--ink-soft); font-size: 14.5px; }
.pager-info b { color: var(--ink-2); }
.pager-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pager-num {
    min-width: 42px; height: 42px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card);
    color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 15px;
}
.pager-num:hover { border-color: var(--gold-l); color: var(--gold-d); }
.pager-num.on {
    background: var(--graphite); color: #fff; border-color: transparent;
    box-shadow: var(--sh-sm); cursor: default;
}
.pager-gap { color: var(--ink-soft); padding: 0 2px; }

@media (max-width: 640px) {
    .pager { justify-content: center; }
    .pager-info { width: 100%; text-align: center; }
    .pager-nav { margin: 0 auto; }
    .pager-num { min-width: 46px; height: 46px; }   /* wygodny cel dotyku */
}
