:root {
    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --gold-500: #d97706;
    --gold-400: #f59e0b;
    --gold-light: #fef3c7;
    --blue-600: #0284c7;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --radius-lg: 22px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
    background: linear-gradient(145deg, #e2e8f0 0%, #f8fafc 100%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
}

.app-wrapper { width: 100%; max-width: 430px; }

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 26px 22px;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }
.gold { color: var(--gold-400); }

/* NAGŁÓWEK */
.brand-header { text-align: center; margin-bottom: 20px; }

.brand-badge {
    display: inline-block;
    background: var(--navy-900);
    color: var(--gold-400);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.brand-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--navy-900);
    letter-spacing: -0.5px;
}

.brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* OCENA GOOGLE */
.google-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--gold-light);
    border: 1px solid #fde68a;
    color: var(--navy-900);
    font-size: 13px;
    text-decoration: none;
}

.stars { color: var(--gold-400); letter-spacing: 1px; }
.rating-count { color: var(--navy-700); font-weight: 600; }

.qr-rating {
    display: inline-block;
    margin: -6px 0 14px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: #e2e8f0;
}

.qr-rating strong { color: var(--white); }

/* REKOMENDACJA */
.recommender-box {
    background: var(--soft);
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--gold-400);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.rec-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.rec-doctor { display: block; font-size: 16px; font-weight: 800; color: var(--navy-900); margin-top: 2px; }

.rec-code {
    display: inline-block;
    margin-top: 4px;
    font-size: 18px;
    font-weight: 800;
    background: var(--navy-900);
    color: var(--gold-400);
    padding: 5px 12px;
    border-radius: 6px;
    letter-spacing: 1px;
}

/* VOUCHER */
.voucher-hero {
    background:
        radial-gradient(circle at 85% 10%, rgba(245, 158, 11, 0.18), transparent 45%),
        linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: var(--white);
    border-radius: 18px;
    padding: 22px 18px;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid var(--navy-700);
}

.voucher-top { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold-400); margin-bottom: 4px; }
.voucher-amount { font-size: 50px; font-weight: 800; line-height: 1.05; }
.voucher-title { font-size: 14px; font-weight: 600; color: #cbd5e1; margin-top: 4px; }
.voucher-divider { height: 1px; background: rgba(255, 255, 255, 0.14); margin: 14px 0; }
.voucher-instruction { font-size: 12.5px; color: #e2e8f0; line-height: 1.5; }

/* DANE SALONU */
.salon-details {
    background: var(--soft);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
}

.detail-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.detail-row + .detail-row { border-top: 1px solid var(--line); }
.detail-icon { font-size: 20px; }
.detail-text { display: flex; flex-direction: column; font-size: 14px; }
.detail-text strong { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.detail-main { font-weight: 700; color: var(--navy-900); }
.phone-highlight { font-size: 18px; font-weight: 800; color: var(--blue-600); text-decoration: none; }

/* PRZYCISKI */
.action-grid, .share-actions { display: flex; flex-direction: column; gap: 10px; }

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: filter 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-gold {
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.btn-gold:hover, .btn-dark:hover, .btn-primary:hover { filter: brightness(1.08); }
.btn-dark { background: var(--navy-900); color: var(--white); }
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-outline { background: var(--soft); color: var(--navy-900); border: 1px solid #cbd5e1; }
.back-dash { margin-top: 12px; }
.review-link { display: block; margin-top: 4px; text-align: center; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.review-link strong { color: var(--blue-600); }

/* LOGOWANIE */
.login-box { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 14px; text-align: center; }
.pin-label { font-size: 13px; font-weight: 600; color: var(--navy-700); }

#pinInput {
    font-size: 28px;
    letter-spacing: 12px;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    font-weight: 800;
    color: var(--navy-900);
    outline: none;
}

#pinInput:focus { border-color: var(--blue-600); }
.error-msg { color: #dc2626; font-size: 12px; font-weight: 600; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-muted); }
.login-hint a { color: var(--blue-600); font-weight: 700; text-decoration: none; }

/* PANEL */
.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.welcome-tag { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.dashboard-topbar h2 { font-size: 18px; font-weight: 800; color: var(--navy-900); }

.btn-logout {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--navy-700);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn.active { background: var(--white); color: var(--navy-900); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease-out; }

/* EKRAN QR */
.qr-presentation-box {
    background:
        radial-gradient(circle at 85% 0%, rgba(245, 158, 11, 0.16), transparent 45%),
        linear-gradient(145deg, var(--navy-900), var(--navy-800));
    color: var(--white);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    margin-bottom: 14px;
}

.qr-badge { font-size: 10px; font-weight: 800; color: var(--gold-400); letter-spacing: 0.8px; display: block; margin-bottom: 6px; }
.qr-presentation-box h3 { font-size: 20px; }
.qr-sub { font-size: 12px; color: #cbd5e1; margin: 2px 0 14px; }

.qr-wrapper {
    background: var(--white);
    padding: 12px;
    border-radius: 14px;
    display: inline-block;
    margin-bottom: 12px;
}

#qrBox, #qrBox img, #qrBox canvas { display: block; width: 180px; height: 180px; }

.snapshot-info {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    line-height: 1.6;
}


/* STATYSTYKI */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.stat-box {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
}

.stat-box.highlight-gold { background: var(--gold-light); border-color: #fde68a; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; display: block; }
.stat-val { font-size: 26px; font-weight: 800; color: var(--navy-900); display: block; margin: 4px 0; }
.stat-sub { font-size: 11px; color: var(--navy-700); font-weight: 600; }

.stats-note { margin-top: 12px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* PANEL ADMINISTRATORA */
.adm-list { display: flex; flex-direction: column; gap: 8px; }

.adm-row {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
}

.adm-who { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.adm-who strong { font-size: 15px; color: var(--navy-900); }
.adm-who span { font-size: 11px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

.adm-nums {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: var(--navy-700);
}

.adm-pay {
    font-size: 16px;
    color: var(--gold-500);
}

.referral-form .form-group { margin-bottom: 12px; }
.referral-form label { display: block; font-size: 11px; font-weight: 700; color: var(--navy-700); margin-bottom: 4px; }

.referral-form input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 16px; /* 16px = brak auto-zoomu na iPhonie */
    outline: none;
    background: var(--white);
}

.referral-form input:focus, .referral-form select:focus { border-color: var(--blue-600); outline: none; }

.tabs.tabs-3 { grid-template-columns: repeat(3, 1fr); }

.tab-badge {
    display: inline-block;
    min-width: 16px;
    margin-left: 3px;
    padding: 0 4px;
    border-radius: 8px;
    background: #dc2626;
    color: var(--white);
    font-size: 10px;
    line-height: 16px;
}

.invite-box h3 { font-size: 15px; color: var(--navy-900); margin-bottom: 6px; }
.invite-box p { font-size: 13px; color: var(--navy-700); line-height: 1.5; }
.join-intro { font-size: 13px; color: var(--navy-700); line-height: 1.5; margin-bottom: 14px; }

#addPartnerToggle { margin-bottom: 16px; }
.add-partner { margin: -4px 0 16px; }

.req-row { border-color: #fde68a; background: var(--gold-light); }
.req-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 10px; }
.req-actions .btn { padding: 9px; font-size: 13px; }
.adm-row a { color: var(--blue-600); text-decoration: none; font-weight: 600; }

.adm-meta { margin-top: 4px; font-size: 11px; color: var(--text-muted); min-height: 22px; }

.adm-remove {
    background: none;
    border: none;
    color: #b91c1c;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    margin-left: auto;
}

.calc-box.created-box { background: #dcfce7; border-color: #86efac; font-size: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.calc-box.created-box > div { display: block; padding: 0; }
.created-title { font-size: 15px; color: #166534; }
.created-pin { font-size: 20px; letter-spacing: 2px; color: var(--navy-900); }

.tabs.tabs-4 { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tabs.tabs-4 .tab-btn { font-size: 11px; line-height: 1.35; padding: 7px 2px; }
.sim-grid { margin-top: 4px; }
.sim-goal { background: var(--gold-light); border-color: #fde68a; }
.sim-goal strong { color: var(--navy-900); }

.referral-form select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 16px;
    background: var(--white);
    color: var(--navy-900);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.calc-box {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
}

.calc-box > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--navy-700); }
.calc-box .minus strong { color: #b91c1c; font-weight: 600; }
.calc-box .calc-sub { border-top: 1px dashed #cbd5e1; margin-top: 2px; padding-top: 6px; font-weight: 700; color: var(--navy-900); }

.calc-box .calc-total {
    border-top: 1px solid #cbd5e1;
    margin-top: 4px;
    padding-top: 8px;
    font-size: 15px;
    color: var(--navy-900);
}

.calc-total strong { color: #15803d; font-size: 17px; }
.neg, .calc-total strong.neg { color: #b91c1c !important; }

.adm-h3 { font-size: 14px; color: var(--navy-900); margin: 20px 0 10px; }
.adm-empty, .adm-hint { font-size: 13px; color: var(--text-muted); text-align: center; padding: 8px 0; }
.adm-hint { margin-bottom: 10px; }
.adm-hint strong { color: var(--gold-500); font-size: 15px; }

.adm-del {
    background: none;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.month-picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.month-picker label { font-size: 13px; font-weight: 700; color: var(--navy-700); }

.month-picker input {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    color: var(--navy-900);
}

/* STOPKA */
.card-footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
}

.stealth-link { background: none; border: none; color: #94a3b8; font-size: 11px; cursor: pointer; text-decoration: underline; }

/* POWIADOMIENIE */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: var(--navy-900);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 50;
}

@media (max-width: 360px) {
    .card { padding: 22px 16px; }
    .voucher-amount { font-size: 42px; }
    .stat-val { font-size: 22px; }
}
