:root {
    --bg: #0a0a0a;
    --bg2: #111;
    --bg3: #1a1a1a;
    --border: #222;
    --red: #E63946;
    --green: #2ecc71;
    --white: #fff;
    --dim: #999;
    --muted: #666;
    --font: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--white);
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.pp-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.pp-nav__logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.pp-nav__logo-img {
    width: 64px; height: 64px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid var(--border);
}

.pp-nav__name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.pp-nav__code {
    font-size: 11px;
    color: var(--muted);
    font-family: monospace;
}

.pp-nav__links {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pp-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}

.pp-nav__link i { width: 18px; text-align: center; font-size: 14px; }

.pp-nav__link:hover { color: var(--white); background: var(--bg3); }

.pp-nav__link.active {
    color: var(--white);
    background: var(--red);
}

.pp-nav__bottom {
    padding: 12px;
    border-top: 1px solid var(--border);
}

/* ─── Main ────────────────────────────────────────────────────────────── */
.pp-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.pp-header {
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    position: sticky;
    top: 0;
    z-index: 50;
}

.pp-header h1 {
    font-size: 20px;
    font-weight: 700;
}

.pp-content {
    padding: 28px 32px;
    flex: 1;
}

/* ─── Loading / Empty ─────────────────────────────────────────────────── */
.pp-loading, .pp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 14px;
}

/* ─── Cards Grid ──────────────────────────────────────────────────────── */
.pp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.pp-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.pp-card__label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pp-card__value {
    font-size: 24px;
    font-weight: 800;
}

.pp-card__sub {
    font-size: 11px;
    color: var(--dim);
    margin-top: 4px;
}

/* ─── Section ──────────────────────────────────────────────────────────── */
.pp-section {
    margin-bottom: 28px;
}

.pp-section h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── Table ─────────────────────────────────────────────────────────────── */
.pp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg2);
}

.pp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pp-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg3);
}

.pp-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--dim);
}

.pp-table tr:last-child td { border-bottom: none; }
.pp-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Form ──────────────────────────────────────────────────────────────── */
.pp-form-group {
    margin-bottom: 16px;
}

.pp-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pp-input, .pp-select, .pp-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}

.pp-input:focus, .pp-select:focus, .pp-textarea:focus { border-color: var(--red); }

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

.pp-select { appearance: none; cursor: pointer; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.pp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}

.pp-btn--accent { background: var(--red); color: var(--white); }
.pp-btn--accent:hover { background: #cf303d; }

.pp-btn--outline {
    background: transparent;
    color: var(--dim);
    border: 1px solid var(--border);
}
.pp-btn--outline:hover { border-color: var(--red); color: var(--red); }

.pp-btn--ghost {
    background: transparent;
    color: var(--dim);
    border: none;
    padding: 6px 10px;
}
.pp-btn--ghost:hover { color: var(--white); background: var(--bg3); }

.pp-btn--sm { padding: 6px 14px; font-size: 12px; }

.pp-btn--icon {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 13px;
}

.pp-btn--danger { color: var(--red); }
.pp-btn--danger:hover { background: rgba(230,57,70,0.1); }

.pp-btn--green { color: var(--green); }
.pp-btn--green:hover { background: rgba(46,204,113,0.1); }

/* ─── Actions Row ───────────────────────────────────────────────────────── */
.pp-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pp-actions .pp-input { width: auto; min-width: 200px; }

/* ─── Badge ─────────────────────────────────────────────────────────────── */
.pp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.pp-badge--green { background: rgba(46,204,113,0.15); color: var(--green); }
.pp-badge--red { background: rgba(230,57,70,0.15); color: var(--red); }
.pp-badge--yellow { background: rgba(241,196,15,0.15); color: #f1c40f; }
.pp-badge--muted { background: var(--bg3); color: var(--dim); }

/* ─── Stars ─────────────────────────────────────────────────────────────── */
.pp-stars { color: #f1c40f; font-size: 12px; }
.pp-star--empty { opacity: 0.2; }

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.pp-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}

.pp-modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.pp-modal h3 {
    font-size: 16px;
    margin-bottom: 20px;
}

.pp-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ─── Chart container ───────────────────────────────────────────────────── */
.pp-chart {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    height: 300px;
    position: relative;
}

.pp-chart canvas { width: 100% !important; height: 100% !important; }

/* ─── Top items list ────────────────────────────────────────────────────── */
.pp-top-list {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.pp-top-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.pp-top-item:last-child { border-bottom: none; }

.pp-top-item__rank {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    margin-right: 12px;
}

.pp-top-item__rank--1 { background: rgba(241,196,15,0.2); color: #f1c40f; }
.pp-top-item__rank--2 { background: rgba(189,195,199,0.2); color: #bdc3c7; }
.pp-top-item__rank--3 { background: rgba(205,127,50,0.2); color: #cd7f32; }
.pp-top-item__rank--other { background: var(--bg3); color: var(--muted); }

.pp-top-item__info { flex: 1; }
.pp-top-item__name { font-size: 13px; font-weight: 600; }
.pp-top-item__cat { font-size: 11px; color: var(--muted); }
.pp-top-item__right { text-align: right; }
.pp-top-item__revenue { font-size: 14px; font-weight: 700; }
.pp-top-item__count { font-size: 11px; color: var(--muted); }

/* ─── Reviews ───────────────────────────────────────────────────────────── */
.pp-review {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.pp-review__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pp-review__name { font-weight: 600; font-size: 13px; }
.pp-review__date { font-size: 11px; color: var(--muted); }
.pp-review__text { font-size: 13px; color: var(--dim); line-height: 1.5; margin-bottom: 8px; }

.pp-review__reply {
    background: var(--bg3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--dim);
    margin-top: 8px;
    border-left: 2px solid var(--red);
}

.pp-review__reply b { color: var(--red); font-size: 11px; }

/* ─── Menu grid ─────────────────────────────────────────────────────────── */
.pp-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.pp-menu-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.pp-menu-card__img {
    width: 100%; height: 140px;
    object-fit: cover;
    background: var(--bg3);
}

.pp-menu-card__body { padding: 14px; }
.pp-menu-card__name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pp-menu-card__cat { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.pp-menu-card__price { font-size: 16px; font-weight: 800; color: var(--green); }
.pp-menu-card__actions { display: flex; gap: 6px; margin-top: 10px; }

/* ─── Branches ──────────────────────────────────────────────────────────── */
.pp-branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.pp-branch-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.pp-branch-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.pp-branch-card__name { font-weight: 600; font-size: 14px; }
.pp-branch-card__code { font-size: 11px; color: var(--muted); font-family: monospace; }
.pp-branch-card__addr { font-size: 12px; color: var(--dim); margin-bottom: 14px; }
.pp-branch-card__perms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* ─── Checkbox group ────────────────────────────────────────────────────── */
.pp-checks { display: flex; flex-wrap: wrap; gap: 12px; }

.pp-check {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--dim); cursor: pointer;
}

.pp-check input { display: none; }

.pp-check span {
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}

.pp-check input:checked + span {
    background: var(--red);
    border-color: var(--red);
}

.pp-check input:checked + span::after {
    content: '✓'; color: var(--white); font-size: 10px; font-weight: 700;
}

/* ─── Profile ───────────────────────────────────────────────────────────── */
.pp-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.pp-logo-upload {
    display: flex; align-items: center; gap: 16px;
}

.pp-logo-preview {
    width: 80px; height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--bg3);
}

/* ─── Analytics ──────────────────────────────────────────────────────────── */
.pp-analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ─── Photo thumb in table ──────────────────────────────────────────────── */
.pp-thumb {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg3);
}

/* ─── Toggle switch ────────────────────────────────────────────────────── */
.pp-toggle {
    position: relative;
    width: 40px; height: 22px;
    cursor: pointer;
}

.pp-toggle input { display: none; }

.pp-toggle__slider {
    position: absolute; inset: 0;
    background: var(--bg3);
    border-radius: 11px;
    transition: .15s;
}

.pp-toggle__slider::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    border-radius: 50%;
    background: var(--dim);
    transition: .15s;
}

.pp-toggle input:checked + .pp-toggle__slider { background: var(--red); }
.pp-toggle input:checked + .pp-toggle__slider::after { background: var(--white); transform: translateX(18px); }

/* ─── Unauthorized Screen ─────────────────────────────────────────── */
.pp-unauth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 40px 20px;
}

.pp-unauth__star {
    margin-bottom: 18px;
    animation: unauthStar 3s ease-in-out infinite;
}

@keyframes unauthStar {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(230,57,70,0.4)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(230,57,70,0.7)); }
}

.pp-unauth__brand {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--white);
    margin-bottom: 28px;
}

.pp-unauth__brand span {
    display: block;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 8px;
    color: var(--dim);
    margin-top: 4px;
}

.pp-unauth__card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 48px;
    max-width: 440px;
    width: 100%;
}

.pp-unauth__icon {
    width: 56px; height: 56px;
    margin: 0 auto 18px;
    border-radius: 14px;
    background: rgba(230,57,70,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--red);
}

.pp-unauth__card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--white);
}

.pp-unauth__card p {
    font-size: 13px;
    color: var(--dim);
    line-height: 1.6;
    margin-bottom: 24px;
}

.pp-unauth__btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.pp-unauth__btns .pp-btn { width: 100%; justify-content: center; }

.pp-unauth__footer {
    margin-top: 32px;
    font-size: 11px;
    color: var(--muted);
}

/* Burger */
.pp-burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}
.pp-burger span {
    display: block;
    width: 20px; height: 2px;
    background: var(--dim);
    border-radius: 1px;
    transition: all .2s;
}
.pp-header { display: flex; align-items: center; }

@media (max-width: 900px) {
    .pp-sidebar {
        width: 60px; min-width: 60px;
    }
    .pp-nav__logo { padding: 16px 8px; }
    .pp-nav__logo-img { width: 36px; height: 36px; }
    .pp-nav__name, .pp-nav__code { display: none; }
    .pp-nav__link { justify-content: center; padding: 10px; }
    .pp-nav__link i { margin: 0; font-size: 16px; }
    .pp-nav__link span { display: none; }
    .pp-main { margin-left: 60px; }
    .pp-profile-grid { grid-template-columns: 1fr; }
    .pp-analytics-grid { grid-template-columns: 1fr; }
    .pp-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 600px) {
    .pp-burger { display: flex; }
    .pp-sidebar {
        display: none;
        width: 260px; min-width: 260px;
        position: fixed; top: 0; left: 0; bottom: 0;
        z-index: 150;
        box-shadow: 4px 0 20px rgba(0,0,0,.4);
    }
    .pp-sidebar--open { display: flex; }
    .pp-main { margin-left: 0; }
    .pp-content { padding: 16px; }
    .pp-header { padding: 14px 16px; }
    .pp-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .pp-card { padding: 14px; }
    .pp-card__value { font-size: 18px; }
    .pp-actions { flex-direction: column; align-items: stretch; }
    .pp-actions .pp-input { min-width: 0; }
    .pp-branch-grid, .pp-menu-grid { grid-template-columns: 1fr; }
}
    .pp-branch-grid, .pp-menu-grid { grid-template-columns: 1fr; }
}

.pp-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--red);
    color: var(--red);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    cursor: help;
    transition: all .2s;
}
.pp-tooltip:hover { background: rgba(230,57,70,.1); transform: scale(1.1); }

.pp-tooltip-popup {
    position: fixed;
    z-index: 9999;
    background: var(--bg2);
    border: 1px solid var(--red);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--dim);
    line-height: 1.6;
    max-width: 280px;
    box-shadow: 0 0 0 4px rgba(230,57,70,.08), 0 0 0 8px rgba(230,57,70,.04), 0 8px 32px rgba(0,0,0,.6);
    opacity: 0;
    transform: translateY(6px) scale(.96);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.pp-tooltip-popup.show { opacity: 1; transform: translateY(0) scale(1); }

.pp-tooltip-popup::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px;
    background: var(--bg2);
    border-right: 1px solid var(--red);
    border-bottom: 1px solid var(--red);
}

@keyframes tooltipPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(230,57,70,.08), 0 0 0 8px rgba(230,57,70,.04), 0 8px 32px rgba(0,0,0,.6); }
    50% { box-shadow: 0 0 0 6px rgba(230,57,70,.12), 0 0 0 12px rgba(230,57,70,.06), 0 8px 32px rgba(0,0,0,.6); }
}
.pp-tooltip-popup.show { animation: tooltipPulse 2s ease-in-out infinite; }

/* Notifications bell */
.pp-nav__bell {
    color: var(--dim);
    font-size: 16px;
    text-decoration: none;
    transition: color .15s;
}
.pp-nav__bell:hover { color: var(--white); }

.pp-nav__bell-badge {
    position: absolute;
    top: -6px; right: -10px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.pp-notif-drop {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    z-index: 300;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}

.pp-notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.pp-notif-item:hover { background: var(--bg3); }
.pp-notif-item:last-child { border-bottom: none; }

.pp-notif-unread { border-left: 2px solid var(--red); }

.pp-notif-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.pp-notif-body {
    font-size: 11px;
    color: var(--dim);
    line-height: 1.4;
    margin-bottom: 4px;
}

.pp-notif-time {
    font-size: 10px;
    color: var(--muted);
}

/* App download banner (dashboard) */
.pp-app-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg2, #111);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pp-app-banner__icon {
    width: 46px; height: 46px;
    min-width: 46px;
    border-radius: 12px;
    background: rgba(230,57,70,.12);
    color: var(--accent, #E63946);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.pp-app-banner__info { flex: 1; min-width: 220px; }
.pp-app-banner__title { font-size: 15px; font-weight: 700; color: #fff; }
.pp-app-banner__text { font-size: 12px; color: var(--dim); margin-top: 4px; line-height: 1.4; }
.pp-app-banner__btn { white-space: nowrap; }

/* App download on unauth screen */
.pp-unauth__app { text-align: center; margin-top: 18px; }

