/* =====================================================
   Urlopy B2B — Design System
   Korporacyjny HR, Inter, sidebar layout
   ===================================================== */



/* === Tokeny === */
:root {
    --ink:          #0f1923;
    --surface:      #f5f7fa;
    --white:        #ffffff;
    --accent:       #1a56db;
    --accent-hover: #1646c0;
    --accent-light: #eff4ff;
    --muted:        #6b7280;
    --border:       #e5e7eb;
    --border-strong:#d1d5db;
    --success:      #057a55;
    --success-bg:   #f0fdf4;
    --warning:      #d97706;
    --warning-bg:   #fffbeb;
    --danger:       #dc2626;
    --danger-bg:    #fef2f2;
    --sidebar-w:    240px;
    --topbar-h:     56px;
    --radius:       8px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:    0 4px 12px rgba(0,0,0,.08);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === Layout główny === */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    /* Signature: lewa krawędź accent z gradientem */
    box-shadow: inset -1px 0 0 var(--border), 4px 0 0 0 var(--accent) inset;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: .7rem;
    color: var(--muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: .75rem .75rem 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    padding: .75rem .5rem .35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: background .15s, color .15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--ink);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item.active .nav-icon { color: var(--accent); }

.nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: .7;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: .75rem;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .75rem;
    border-radius: var(--radius);
    cursor: default;
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: .72rem;
    color: var(--muted);
}

/* === Topbar (mobile) === */
.topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

.topbar-brand {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    flex: 1;
}

.hamburger {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; cursor: pointer;
    border-radius: 6px;
    color: var(--ink);
}
.hamburger:hover { background: var(--surface); }

/* === Główna treść === */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 1.75rem 2rem 0;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.02em;
}

.page-subtitle {
    font-size: .875rem;
    color: var(--muted);
    margin-top: .2rem;
}

.page-body {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
}

/* === Karty === */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
}

.card-body { padding: 1.25rem; }

/* === Statystyki (salda urlopowe) === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .35rem;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-value span {
    font-size: .9rem;
    font-weight: 500;
    color: var(--muted);
    margin-left: .25rem;
}

.stat-accent { border-top: 3px solid var(--accent); }
.stat-success { border-top: 3px solid var(--success); }
.stat-warning { border-top: 3px solid var(--warning); }

/* === Tabela === */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead th {
    padding: .65rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface); }

/* === Badge statusu === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-waiting  { background: var(--warning-bg); color: var(--warning); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg);  color: var(--danger); }
.badge-canceled { background: var(--surface);     color: var(--muted); border: 1px solid var(--border); }

/* === Przyciski === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: inherit;
    transition: background .15s, box-shadow .15s, opacity .15s;
    white-space: nowrap;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-full { width: 100%; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(26,86,219,.25);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-ghost {
    background: transparent;
    color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface); color: var(--ink); }

.btn-entra {
    background: #2f2f2f;
    color: #fff;
}
.btn-entra:hover:not(:disabled) { background: #1a1a1a; }

/* === Formularze === */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1rem;
}

.form-label {
    font-size: .82rem;
    font-weight: 500;
    color: var(--ink);
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    padding: .55rem .8rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: .875rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.form-hint {
    font-size: .75rem;
    color: var(--muted);
}

.form-error {
    font-size: .75rem;
    color: var(--danger);
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* === Alerty === */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    font-size: .875rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1rem;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.alert-info    { background: var(--accent-light); color: var(--accent); border: 1px solid #bfdbfe; }

/* === Auth (strona logowania) === */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.75rem;
}

.auth-logo-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.auth-logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.auth-logo-sub {
    font-size: .72rem;
    color: var(--muted);
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .25rem;
}

.auth-subtitle {
    font-size: .875rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: var(--muted);
    font-size: .8rem;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border);
}

.auth-hint {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .75rem;
}

/* === Overlay mobilny === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 99;
}

/* === Responsive === */
@media (max-width: 768px) {
    .topbar { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        top: 0;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-md);
    }

    .sidebar-overlay.open { display: block; }

    .main-content {
        margin-left: 0;
        padding-top: var(--topbar-h);
    }

    .page-header { padding: 1.25rem 1rem 0; }
    .page-body   { padding: 1rem 1rem 2rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .auth-card  { padding: 1.5rem; }
}

/* === Utilities === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--muted); }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }

/* === Search box === */
.search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 320px;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: .55rem 2rem .55rem 2.1rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 8px;
    font-size: .875rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s, background .15s;
    line-height: 1.4;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.search-input::placeholder { color: var(--muted); }
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
    position: absolute;
    right: .45rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: var(--border-strong);
    border-radius: 50%;
    cursor: pointer;
    color: var(--muted);
    transition: background .15s, color .15s;
    padding: 0;
    z-index: 1;
}

.search-clear:hover { background: var(--muted); color: #fff; }

@media (max-width: 768px) {
    .search-box { width: 100%; }
}

/* === Formularz wniosku === */
.radio-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
    transition: border-color .15s, background .15s, color .15s;
    user-select: none;
}

.radio-option input[type="radio"] { display: none; }

.radio-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.radio-option:hover:not(.selected) {
    border-color: var(--border-strong);
    color: var(--ink);
}

.halfday-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .75rem 1rem;
}

.halfday-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .5rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    cursor: pointer;
    color: var(--ink);
}

.checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.days-preview {
    display: flex;
    align-items: center;
    padding: .65rem 1rem;
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: .875rem;
    color: var(--accent);
    font-weight: 500;
    gap: .5rem;
    flex-wrap: wrap;
}

.days-preview-warn {
    background: var(--warning-bg);
    border-color: #fde68a;
    color: var(--warning);
}

.text-danger { color: var(--danger); }

/* === Modal === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.modal-body { padding: 1.25rem; }

.modal-footer {
    display: flex;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* Wiersz oczekujacy w tabeli */
.row-pending td { background: #fffbeb; }

/* === Kalendarz urlopowy === */
.lc-wrapper {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    width: 100%;
    max-width: 340px;
    user-select: none;
}

.lc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.lc-month-label {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
    text-transform: capitalize;
}

.lc-nav {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 28px; height: 28px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
    line-height: 1;
}
.lc-nav:hover { background: var(--surface); color: var(--ink); }

.lc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.lc-dow {
    text-align: center;
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
    padding: .25rem 0 .4rem;
}

.lc-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .1s, color .1s;
    position: relative;
}

.lc-empty { cursor: default; }

.lc-available:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* Zakres — środek */
.lc-in-range {
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 0;
    cursor: pointer;
}

/* Start zakresu */
.lc-range-start {
    background: var(--accent) !important;
    color: #fff !important;
    border-radius: 6px 0 0 6px;
}

/* Koniec zakresu */
.lc-range-end {
    background: var(--accent) !important;
    color: #fff !important;
    border-radius: 0 6px 6px 0;
}

/* Jeden dzień (start = end) */
.lc-range-start.lc-range-end {
    border-radius: 6px !important;
}

.lc-selected { font-weight: 700; }

.lc-taken {
    background: #fef2f2;
    color: var(--danger);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: .7;
}

.lc-holiday {
    color: var(--muted);
    cursor: not-allowed;
    opacity: .4;
}

.lc-legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
    font-size: .72rem;
    color: var(--muted);
}

.lc-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}
.lc-dot-selected { background: var(--accent); }
.lc-dot-taken    { background: #fecaca; }
.lc-dot-holiday  { background: var(--border); }

/* === Layout wniosku (kalendarz + formularz) === */
.leave-form-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .leave-form-grid {
        grid-template-columns: 1fr;
    }
    .lc-wrapper { max-width: 100%; }
}


/* === Ekran wyboru modułu === */
.module-shell {
    min-height: 100vh;
    background: var(--surface);
    padding: 2.5rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.module-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.module-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    position: relative;
}

.module-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(26,86,219,.12);
    transform: translateY(-2px);
}

.module-card-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: .25rem;
}

.module-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.module-card-desc {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.4;
    flex: 1;
}

.module-card-arrow {
    font-size: 1.1rem;
    color: var(--accent);
    margin-top: .5rem;
    transition: transform .15s;
}

.module-card:hover .module-card-arrow {
    transform: translateX(4px);
}

@media (max-width: 480px) {
    .module-grid { grid-template-columns: 1fr; }
    .module-shell { padding: 1.5rem 1rem; }
}


/* ================================================================
   KIOSK — Tablet-first, touch-friendly, elegancki
   ================================================================ */

/* Shell — centruje wszystko na ekranie tabletu */
.kiosk-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4ff 0%, #f8faff 60%, #fff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem 3rem;
}

.kiosk-error {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: var(--muted);
    font-size: 1.1rem;
    background: var(--surface);
}

/* Logo */
.kiosk-logo {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 3rem;
}

.kiosk-logo-icon {
    width: 52px; height: 52px;
    background: var(--accent);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(26,86,219,.3);
}

.kiosk-logo-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
}

.kiosk-logo-sub {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 400;
}

/* Topbar (Wróć + flaga języka) */
.kiosk-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 620px;
    margin-bottom: 1.5rem;
}

.kiosk-lang-indicator {
    font-size: 1.6rem;
    line-height: 1;
}

.kiosk-back {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: .45rem .9rem;
    font-size: .9rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.kiosk-back:hover { background: var(--accent-light); }

/* Tytuły */
.kiosk-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.kiosk-subtitle {
    font-size: 1rem;
    color: var(--muted);
    text-align: center;
    max-width: 460px;
    line-height: 1.55;
}

/* Karta formularza */
.kiosk-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(26,86,219,.08), 0 2px 8px rgba(0,0,0,.04);
    padding: 2rem 2rem 2.25rem;
    width: 100%;
    max-width: 620px;
    margin-top: 1rem;
}

.kiosk-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1.5px solid var(--border);
}

.kiosk-card-icon { font-size: 2rem; line-height: 1; }

.kiosk-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

/* Siatka języków */
.kiosk-lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 460px;
    margin-top: 2rem;
}

.kiosk-lang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 1.75rem 1rem;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .12s;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.kiosk-lang-btn:hover, .kiosk-lang-btn:focus {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(26,86,219,.15);
    transform: translateY(-3px);
    outline: none;
}

.kiosk-lang-flag { font-size: 2.75rem; line-height: 1; }
.kiosk-lang-name { font-size: 1rem; font-weight: 600; color: var(--ink); }

/* Siatka wyboru formularza */
.kiosk-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    width: 100%;
    max-width: 560px;
    margin-top: 1.5rem;
}

.kiosk-form-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2.25rem 1.5rem;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 18px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .12s;
    font-family: inherit;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.kiosk-form-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(26,86,219,.14);
    transform: translateY(-3px);
}

.kiosk-form-icon  { font-size: 2.75rem; line-height: 1; }
.kiosk-form-title { font-size: 1rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.kiosk-form-desc  { font-size: .82rem; color: var(--muted); line-height: 1.4; }

/* Formularz */
.kiosk-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.kiosk-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.kiosk-field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.kiosk-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.kiosk-required { color: var(--danger); margin-left: 2px; }

.kiosk-input {
    padding: .9rem 1rem;
    font-size: 1.05rem;
    font-family: inherit;
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s, background .15s;
    width: 100%;
}

.kiosk-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26,86,219,.1);
}

.kiosk-input::placeholder { color: #b0b8c9; }

.kiosk-hint {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.4;
}

/* Toggle NIP/PESEL */
.kiosk-toggle {
    display: flex;
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: .25rem;
}

.kiosk-toggle-btn {
    flex: 1;
    padding: .75rem;
    font-size: .9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: var(--surface);
    color: var(--muted);
    transition: background .15s, color .15s;
}

.kiosk-toggle-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Przycisk submit */
.kiosk-btn {
    padding: 1.1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background .15s, transform .1s, box-shadow .15s;
    width: 100%;
    margin-top: .5rem;
    letter-spacing: .01em;
}

.kiosk-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.kiosk-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,86,219,.3);
}

.kiosk-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,86,219,.35);
}

/* Strona podziękowań */
.kiosk-thankyou {
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
}

.kiosk-check {
    width: 80px; height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(5,122,85,.3);
    margin-bottom: .5rem;
}

/* Responsywność */
@media (max-width: 560px) {
    .kiosk-shell    { padding: 1.5rem 1rem 2rem; }
    .kiosk-card     { padding: 1.5rem 1.25rem; border-radius: 14px; }
    .kiosk-title    { font-size: 1.35rem; }
    .kiosk-lang-grid, .kiosk-form-grid { grid-template-columns: 1fr; }
    .kiosk-row      { grid-template-columns: 1fr; }
    .kiosk-input    { font-size: 1rem; }
    .kiosk-btn      { font-size: 1rem; padding: 1rem; }
    .kiosk-logo     { margin-bottom: 2rem; }
}

/* === Dodatkowe badge i elementy === */
.badge-info { background: var(--accent-light); color: var(--accent); }

.detail-key {
    padding: .45rem .75rem .45rem 0;
    color: var(--muted);
    font-weight: 600;
    font-size: .82rem;
    width: 38%;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.detail-key + td {
    padding: .45rem 0;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
}

/* Sekcja w formularzu kiosku */
.kiosk-section-label {
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .5rem 0 .25rem;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: .25rem;
}

.kiosk-hint-inline {
    font-size: .78rem;
    font-weight: 400;
    color: var(--muted);
    margin-left: .3rem;
}

/* Kiosk row z flex (nie grid) dla elastycznych proporcji */
.kiosk-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.kiosk-row .kiosk-field { flex: 1; min-width: 120px; }

/* === Placeholder tags w szablonach === */
.placeholder-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: .3rem .6rem;
    font-size: .8rem;
    cursor: default;
}

.placeholder-tag code {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: .82rem;
    color: var(--accent);
    font-weight: 600;
}

.placeholder-desc {
    color: var(--muted);
    font-size: .75rem;
}

/* === Zakładki (tabs) === */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: .65rem 1.25rem;
    font-size: .875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-badge {
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    padding: .1rem .45rem;
    line-height: 1.4;
}

/* === Spinner inline === */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
