:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e0ea;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --accent: #f59e0b;
    --danger: #dc2626;
    --ok: #16a34a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }

.shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 240px;
    background: #101828;
    color: #fff;
    padding: 22px;
}
.brand { font-size: 22px; font-weight: 700; margin-bottom: 28px; }
.nav a {
    display: block;
    color: #d0d5dd;
    padding: 11px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
}
.nav a:hover, .nav a.active { background: #1d2939; color: #fff; }
.main { flex: 1; padding: 28px; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.metric { font-size: 28px; font-weight: 700; margin-top: 8px; }
.muted { color: var(--muted); }
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: #eef4ff;
}
.status.ok { color: var(--ok); background: #ecfdf3; }
.status.bad { color: var(--danger); background: #fef3f2; }
.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.btn.secondary { background: #344054; }
.btn.danger { background: var(--danger); }
.btn.light { background: #e6f3f1; color: var(--brand-dark); }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}
label { display: block; font-weight: 700; margin: 12px 0 6px; }
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
th { background: #f8fafc; color: #475467; font-size: 13px; }
.auth {
    max-width: 420px;
    margin: 70px auto;
}
.customer {
    max-width: 760px;
    margin: 34px auto;
    padding: 0 16px;
}
.notice { padding: 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fedf89; }
.error { padding: 12px; border-radius: 8px; background: #fef3f2; border: 1px solid #fecdca; color: var(--danger); }
.success { padding: 12px; border-radius: 8px; background: #ecfdf3; border: 1px solid #abefc6; color: var(--ok); }
code { background: #f2f4f7; padding: 3px 5px; border-radius: 4px; word-break: break-all; }

@media (max-width: 900px) {
    .shell { display: block; }
    .sidebar { width: 100%; }
    .grid, .grid.two { grid-template-columns: 1fr; }
    .main { padding: 18px; }
    .topbar { display: block; }
}

/* Shop application */
.shop-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.shop-sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 16px; background: #17191f; color: #fff; display: flex; flex-direction: column; }
.shop-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #ffca28; color: #17191f; font-size: 13px; }
.shop-nav { display: grid; gap: 5px; margin-top: 34px; }
.shop-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 7px; color: #b9bdc8; font-weight: 700; }
.shop-nav a:hover, .shop-nav a.active { color: #fff; background: #292c34; }
.nav-icon { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #3b3e47; color: #ffca28; font-size: 12px; font-weight: 800; }
.sidebar-account { margin-top: auto; display: grid; gap: 4px; padding: 14px 10px 2px; border-top: 1px solid #33363e; }
.sidebar-account span { color: #9297a3; font-size: 12px; }
.sidebar-account a { margin-top: 8px; color: #ffca28; font-size: 13px; }
.shop-main { min-width: 0; padding: 28px; }
.mobile-shop-header { display: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: 0; }
.eyebrow { margin: 0; color: #7b8190; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 0; }
.panel { background: #fff; border: 1px solid #e1e5eb; border-radius: 8px; padding: 20px; margin-bottom: 18px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .85fr); gap: 18px; align-items: start; }
.content-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.section-title h2, .panel h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.section-title p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.span-2 { grid-column: 1 / -1; }
.count-badge, .fee-pill { padding: 6px 10px; border-radius: 999px; background: #fff7d6; color: #765800; font-size: 12px; font-weight: 800; }
.stack-list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #e6e8ec; border-radius: 7px; }
.list-row .grow { min-width: 0; display: grid; gap: 4px; }
.list-row .grow span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.printer-symbol { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 7px; background: #e8f5f2; color: var(--brand); font-weight: 800; }
.icon-action { border: 0; background: transparent; padding: 7px; cursor: pointer; }
.danger-text { color: var(--danger); }
.billing-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; margin-bottom: 18px; border-radius: 8px; background: #20232a; color: #fff; }
.billing-hero h2 { margin: 4px 0; font-size: 26px; }
.billing-hero p:last-child { margin: 0; color: #c6cad3; }
.balance-box { min-width: 190px; padding-left: 24px; border-left: 1px solid #4b4f59; display: grid; gap: 5px; }
.balance-box span { color: #b7bbc5; font-size: 12px; }
.balance-box strong { font-size: 27px; color: #ffca28; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.full { width: 100%; text-align: center; }
.plans-section { margin: 28px 0; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { position: relative; padding: 24px; background: #fff; border: 1px solid #e1e5eb; border-radius: 8px; display: flex; flex-direction: column; }
.plan-card.featured { border: 2px solid #ff3d6e; }
.popular-label { position: absolute; top: -12px; right: 20px; padding: 5px 12px; border-radius: 999px; background: #ff3d6e; color: #fff; font-size: 11px; font-weight: 800; }
.plan-name { margin: 0; font-size: 17px; font-weight: 800; }
.plan-price { margin-top: 12px; font-size: 42px; line-height: 1; font-weight: 800; color: #ff315f; }
.plan-price span { font-size: 22px; }
.plan-period { color: var(--muted); }
.plan-card ul { padding: 16px 0; margin: 8px 0 22px; border-top: 1px solid #eceef2; list-style: none; flex: 1; }
.plan-card li { display: flex; gap: 8px; margin: 11px 0; font-size: 14px; }
.plan-card li span { color: #139b59; font-weight: 800; }
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap table { min-width: 760px; }
.amount-credit { color: #118546; font-weight: 700; }
.amount-debit { color: #cf2e2e; font-weight: 700; }
.filter-panel { padding-bottom: 14px; }
.report-filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto; gap: 10px; align-items: end; }
.report-filters label { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 110px; padding: 17px; border: 1px solid #e1e5eb; border-radius: 8px; background: #fff; display: grid; align-content: center; gap: 5px; }
.stat-card span, .stat-card small { color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 26px; }
.price-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.price-input { margin: 0 0 18px; padding: 16px; border: 1px solid #dfe4e9; border-radius: 8px; background: #f8fafb; }
.price-input > span, .price-input small { display: block; }
.price-input > div { display: flex; align-items: center; gap: 5px; margin: 8px 0; }
.price-input b { font-size: 24px; }
.price-input input { border: 0; padding: 0; background: transparent; font-size: 26px; font-weight: 800; }
.price-input small { color: var(--muted); font-weight: 400; }
.price-input.color { border-color: #ffd0dc; background: #fff7f9; }
.toggle-list { display: grid; gap: 9px; margin: 12px 0 20px; }
.toggle-list label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px; border: 1px solid #e3e6eb; border-radius: 7px; }
.toggle-list input { width: auto; margin-top: 3px; }
.toggle-list span { display: grid; gap: 3px; }
.toggle-list small { color: var(--muted); font-weight: 400; }
.rate-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e8eaee; }
.dashboard-strip { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; margin-bottom: 18px; border: 1px solid #dfe3e8; border-radius: 8px; background: #fff; }
.dashboard-strip > div { position: relative; display: grid; gap: 4px; padding: 16px 20px; border-right: 1px solid #e6e8ec; }
.dashboard-strip > div:last-child { border: 0; }
.dashboard-strip span, .dashboard-strip small { color: var(--muted); font-size: 12px; }
.live-dot { position: absolute; top: 19px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: #e14949; }
.live-dot.online { background: #1aaa61; }
.qr-overview { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); }
.qr-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; background: #fffdf5; border-color: #f0e0a6; }
.qr-panel img { width: 150px; height: 150px; padding: 8px; background: #fff; border: 1px solid #e4e6e9; }
.qr-panel p { color: var(--muted); max-width: 520px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-links > a { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #eceef1; color: var(--text); }
.quick-links > a div { flex: 1; display: grid; gap: 3px; }
.quick-links small { color: var(--muted); }
.status-form { display: flex; gap: 6px; min-width: 220px; }
.status-form select { min-width: 110px; }
.file-cell { max-width: 260px; overflow-wrap: anywhere; }
.status.warning { color: #9a6500; background: #fff7d6; }
.status-printed { color: #118546; background: #e9f8ef; }
.status-failed, .status-cancelled { color: #c83232; background: #fff0f0; }
.status-queued, .status-picked { color: #275fba; background: #edf4ff; }
.empty-state { padding: 28px !important; text-align: center; color: var(--muted); }
.referral-hero { display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:18px;padding:26px;border-radius:8px;background:#20232a;color:#fff; }
.referral-hero h2 { margin:5px 0 8px;font-size:27px;letter-spacing:0; }
.referral-hero p { max-width:690px;margin:0;color:#c3c7d0;line-height:1.55; }
.referral-link { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:18px; }
.referral-link input { min-width:0;border-color:#4a4e57;background:#30333b;color:#fff; }
.referral-share { display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-top:11px;font-size:12px; }
.referral-share a { color:#ffca28;font-weight:800; }
.referral-share span { color:#b9bdc6; }
.reward-coin { flex:0 0 150px;height:150px;display:grid;place-items:center;align-content:center;border:8px solid #65582b;border-radius:50%;background:#ffca28;color:#20232a;box-shadow:0 18px 35px rgba(0,0,0,.2); }
.reward-coin span { font-size:16px;font-weight:800; }
.reward-coin strong { font-size:48px;line-height:1; }
.reward-coin small { margin-top:4px;font-size:10px;font-weight:800; }
.referral-earned { border-color:#b9e5d0;background:#f2fbf6; }
.referral-filters { grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(125px,1fr)) auto; }
.download-identity { display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:18px;padding:24px;border-radius:8px;background:#20232a;color:#fff; }
.download-identity h2 { margin:5px 0;font-size:30px;letter-spacing:0; }
.download-identity p { margin:0 0 14px;color:#c4c8d1; }
.identity-status { min-width:240px;padding-left:24px;border-left:1px solid #494d57;display:grid;gap:5px; }
.identity-status span,.identity-status small { color:#b8bdc7;font-size:12px; }
.identity-status strong { color:#ffca28;font-size:20px; }
.download-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px; }
.download-card { display:flex;flex-direction:column;align-items:flex-start;padding:22px;border:1px solid #e1e5eb;border-radius:8px;background:#fff; }
.download-card h2 { margin:14px 0 5px;font-size:19px; }
.download-card p { margin:0;color:var(--muted);line-height:1.55; }
.download-icon { display:grid;place-items:center;width:44px;height:44px;border-radius:8px;background:#fff1f5;color:#d92957;font-size:12px;font-weight:900; }
.download-icon.agent { background:#e8f6f4;color:#087f7b; }
.download-qr { width:180px;height:180px;margin:20px auto;padding:7px;border:1px solid #e3e6eb; }
.download-actions { width:100%;display:flex;gap:8px;flex-wrap:wrap; }
.logo-manager .section-title img{width:120px;height:70px;object-fit:contain;border:1px solid #e1e5eb;border-radius:6px;background:#fff}.logo-upload-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;margin-bottom:10px}.logo-upload-row input{padding:8px}@media(max-width:600px){.logo-upload-row{grid-template-columns:1fr}.logo-manager .section-title{flex-direction:column}.logo-manager .section-title img{width:100%;height:100px}}
.package-details { width:100%;display:grid;gap:0;margin:20px 0; }
.package-details span { display:flex;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid #eceef1;color:var(--muted);font-size:12px; }
.package-details b { color:var(--text);text-align:right;overflow-wrap:anywhere; }
.install-steps ol { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0;margin:0;list-style:none;counter-reset:install; }
.install-steps li { display:grid;gap:6px;padding:14px;border:1px solid #e4e7eb;border-radius:7px;counter-increment:install; }
.install-steps li::before { content:counter(install);display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#ffca28;font-size:11px;font-weight:900; }
.install-steps li span { color:var(--muted);font-size:12px;line-height:1.5; }

@media (max-width: 1100px) {
    .plan-grid { grid-template-columns: 1fr; }
    .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .shop-shell { display: block; }
    .shop-sidebar { position: fixed; z-index: 30; width: min(300px, 84vw); left: -310px; transition: left .2s ease; box-shadow: 12px 0 30px rgba(0,0,0,.2); }
    .menu-open .shop-sidebar { left: 0; }
    .menu-open::after { content: ''; position: fixed; z-index: 20; inset: 0; background: rgba(17,19,24,.45); }
    .shop-main { padding: 0 14px 24px; }
    .mobile-shop-header { display: flex; align-items: center; justify-content: space-between; margin: 0 -14px 18px; padding: 12px 14px; background: #17191f; }
    .menu-button { border: 1px solid #484b54; border-radius: 6px; padding: 8px 10px; color: #fff; background: #292c34; }
    .page-heading { align-items: flex-start; }
    .page-heading h1 { font-size: 23px; }
    .page-heading > .btn { padding: 9px 10px; font-size: 12px; }
    .content-grid, .content-grid.two-col, .qr-overview { grid-template-columns: 1fr; }
    .form-grid, .price-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .billing-hero { align-items: flex-start; flex-direction: column; }
    .balance-box { width: 100%; padding: 14px 0 0; border-left: 0; border-top: 1px solid #4b4f59; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { min-height: 96px; padding: 13px; }
    .stat-card strong { font-size: 21px; }
    .dashboard-strip { grid-template-columns: 1fr; }
    .dashboard-strip > div { border-right: 0; border-bottom: 1px solid #e6e8ec; }
    .qr-panel { align-items: flex-start; }
    .qr-panel img { width: 110px; height: 110px; }
    .report-filters { grid-template-columns: 1fr; }
    .inline-form { grid-template-columns: 1fr; }
    .panel { padding: 16px; }
    .referral-hero { align-items:flex-start;flex-direction:column; }
    .reward-coin { align-self:center; }
    .referral-link { grid-template-columns:1fr; }
    .download-identity { align-items:flex-start;flex-direction:column; }
    .identity-status { width:100%;min-width:0;padding:14px 0 0;border-left:0;border-top:1px solid #494d57; }
    .download-grid { grid-template-columns:1fr; }
    .install-steps ol { grid-template-columns:1fr 1fr; }
}

@media (max-width: 420px) {
    .stat-grid { grid-template-columns: 1fr; }
    .qr-panel { display: grid; }
    .qr-panel img { grid-row: 1; }
}
/* Shop profile */
.printer-health{display:flex;align-items:center;gap:20px;margin-bottom:18px;padding:20px;border:1px solid #e1e5eb;border-radius:8px;background:#fff}.printer-health>div:first-child{position:relative;flex:1;padding-left:22px}.printer-health h2{margin:4px 0;font-size:21px}.printer-health small{color:var(--muted)}.health-indicator{position:absolute;left:0;top:4px;width:11px;height:11px;border-radius:50%;background:#d54141;box-shadow:0 0 0 5px #fdeaea}.printer-health.online .health-indicator{background:#15975b;box-shadow:0 0 0 5px #e4f6ec}.printer-health-count{display:grid;text-align:right}.printer-health-count strong{font-size:25px}.printer-health-count span,.printer-status-row .grow small{color:var(--muted);font-size:11px}.status.bad{color:var(--danger);background:#fef3f2}@media(max-width:700px){.printer-health{align-items:flex-start;flex-wrap:wrap}.printer-health-count{text-align:left}.printer-health .btn{width:100%;text-align:center}.printer-status-row{align-items:flex-start;flex-wrap:wrap}.printer-status-row .grow{flex-basis:calc(100% - 50px)}}
.profile-grid{grid-template-columns:minmax(0,1.5fr) minmax(260px,.7fr)}
.profile-policy{align-self:start}.profile-policy>p:not(.eyebrow){color:#667085;line-height:1.65}
.profile-summary{display:grid;gap:5px;margin-top:24px;padding-top:20px;border-top:1px solid #e5e7eb}
.profile-summary span{margin-top:10px;color:#667085;font-size:12px;text-transform:uppercase;font-weight:700}
.profile-summary strong{font-size:16px}.settings-form input:disabled{background:#f3f4f6;color:#667085;cursor:not-allowed}
@media(max-width:800px){.profile-grid{grid-template-columns:1fr}.profile-policy{order:-1}}
