:root {
    --bg: #ffffff;
    --bg2: #f4f6f5;
    --card: #ffffff;
    --line: #e5e9e5;
    --txt: #0d1b2a;
    --muted: #6b7280;
    --accent: #00d632;
    --accent2: #00a828;
    --green: #00d632;
    --amber: #f59e0b;
    --red: #ef4444;
    --radius: 16px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    color: var(--txt);
    background: var(--bg);
    min-height: 100vh;
}
.tp-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.9rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 100;
}
.tp-brand { color: var(--txt); font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.tp-brand i { color: var(--accent); }
.tp-nav-links { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.tp-nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.tp-nav-links a:hover { color: var(--accent2); }
.tp-user { color: var(--accent2); font-size: 0.85rem; font-weight: 700; }
.tp-burger {
    display: none; background: #eef7ee; border: 1px solid var(--line);
    color: var(--accent2); border-radius: 10px; width: 44px; height: 44px;
    font-size: 1.1rem; cursor: pointer;
}
/* Mobile menu: hamburger + dropdown panel */
@media (max-width: 640px) {
    .tp-burger { display: block; }
    .tp-nav { position: sticky; }
    .tp-nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--line);
        box-shadow: 0 14px 30px rgba(0,0,0,0.12);
        flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem;
    }
    .tp-nav-links.open { display: flex; }
    .tp-nav-links a, .tp-nav-links .tp-user {
        padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.95rem;
    }
    .tp-nav-links a:hover { background: #f0f7f0; }
}
.tp-wrap { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.tp-foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 2rem 1rem; }
.tp-flash { padding: 0.85rem 1.1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: 0.92rem; }
.tp-flash.ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b7a3d; }
.tp-flash.err { background: #fdecea; border: 1px solid #f5c6cb; color: #c0392b; }
.tp-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    margin-bottom: 1.5rem;
}
.tp-card h1, .tp-card h2 { margin: 0 0 0.5rem; color: var(--txt); }
.tp-sub { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.92rem; }
.tp-sub code { background: #eef7ee; padding: 2px 6px; border-radius: 4px; color: var(--accent2); }
.tp-amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -1px; color: var(--txt); }
.tp-chips { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
.tp-chip {
    background: #f0f7f0; border: 1px solid #cde9cf;
    color: #0d7a2e; border-radius: 999px; padding: 0.65rem 1.2rem;
    cursor: pointer; font-size: 0.95rem; font-weight: 700; min-height: 44px;
}
.tp-chip:hover, .tp-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tp-field { margin: 1rem 0; }
.tp-field label { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 0.4rem; font-weight: 600; }
.tp-field input, .tp-field select {
    width: 100%; padding: 0.85rem 1rem; font-size: 1.1rem;
    background: #fff; border: 2px solid var(--line);
    border-radius: 12px; color: var(--txt);
}
.tp-field input:focus, .tp-field select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 214, 50, 0.18);
}
.tp-btn {
    display: inline-block; border: none; cursor: pointer; text-decoration: none;
    background: var(--accent); color: #fff;
    padding: 0.95rem 1.75rem; border-radius: 12px; font-weight: 800; font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(0, 214, 50, 0.3); width: 100%; text-align: center;
    min-height: 52px;
}
.tp-btn:hover { filter: brightness(0.95); }
.tp-btn:disabled { opacity: 0.6; }
.tp-btn.ghost { background: #eef0f3; box-shadow: none; border: none; color: #37474f; width: auto; padding: 0.55rem 1rem; font-size: 0.85rem; min-height: 44px; }
table.tp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.tp-table th { text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; padding: 0.7rem 0.8rem; border-bottom: 2px solid var(--accent); white-space: nowrap; }
table.tp-table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid #f0f0f0; color: var(--txt); }
table.tp-table tr:hover td { background: #f6faf6; }
.tp-table a { color: var(--accent2); }
.tp-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.tp-open { background: #fff8e1; color: #b7791f; border: 1px solid #f0d48a; }
.tp-settled { background: #e8f5e9; color: #1b7a3d; border: 1px solid #a5d6a7; }
.tp-expired, .tp-canceled { background: #f1f3f4; color: #6b7280; }
.tp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tp-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: 0 6px 18px rgba(0,0,0,0.05); }
.tp-stat .k { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; }
.tp-stat .v { font-size: 1.7rem; font-weight: 800; color: var(--txt); }
.tp-stat .s { color: var(--muted); font-size: 0.8rem; }
.tp-qr { display: flex; justify-content: center; background: #fff; border-radius: 12px; padding: 14px; width: fit-content; margin: 1rem auto; }
.tp-secret { word-break: break-all; font-size: 0.72rem; color: var(--muted); background: #f4f6f5; border-radius: 8px; padding: 0.7rem; font-family: monospace; }
.tp-status-live { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.9rem; border-radius: 10px; background: #eef7ee; border: 1px solid #cde9cf; color: #0d7a2e; font-weight: 600; margin-top: 1rem; }
.tp-status-paid { background: #e8f5e9; border-color: #a5d6a7; color: #1b7a3d; }
.tp-status-dead { background: #fdecea; border-color: #f5c6cb; color: #c0392b; }
.tp-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); border-top-color: var(--accent); animation: tpspin 0.8s linear infinite; display: inline-block; }
@keyframes tpspin { to { transform: rotate(360deg); } }
.tp-copy { background: #eef0f3; border: none; color: #37474f; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 0.85rem; font-weight: 700; min-height: 44px; }
/* Mobile: full-width cards, big tap targets, no horizontal squeeze */
@media (max-width: 600px) {
    .tp-wrap { padding: 1rem 0.75rem 3rem; }
    .tp-card { padding: 1.25rem; border-radius: 14px; }
    .tp-amount { font-size: 2.1rem; }
    .tp-nav { padding: 0.75rem 1rem; }
    .tp-brand { font-size: 0.95rem; }
    .tp-stats { grid-template-columns: 1fr 1fr; }
    table.tp-table { font-size: 0.82rem; }
}
/* Admin forms: side-by-side on desktop, stacked on mobile */
.tp-formgrid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: end; }
@media (max-width: 600px) {
    .tp-formgrid { grid-template-columns: 1fr; }
    .tp-formgrid .tp-btn { width: 100%; }
    table.tp-table td .tp-btn.ghost { margin: 2px 0; }
    .tp-nav-links { gap: 0.6rem; }
    .tp-nav-links a { font-size: 0.82rem; }
}
