:root {
    --ink: #122033;
    --muted: #64748b;
    --line: #e6edf5;
    --bg: #f4f7fb;
    --card: #ffffff;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #e7f6f3;
    --sidebar: #101b2d;
    --danger: #e11d48;
    --shadow: 0 12px 32px rgba(16, 32, 51, 0.06);
    --radius: 16px;
    --sidebar-w: 268px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand-dark); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { letter-spacing: -0.02em; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}
.btn-primary, .btn-light, .btn-outline-primary, .btn-outline-secondary { border-radius: 10px; font-weight: 650; }
.form-control, .form-select { border-radius: 10px; border-color: #d7e0ea; min-height: 42px; }
.form-control:focus, .form-select:focus {
    border-color: #5eead4;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #132238 0%, #101b2d 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    z-index: 20;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 0 8px 18px;
}
.brand strong { display: block; font-size: 18px; }
.brand small { color: #94a3b8; }
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    font-weight: 800;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 12px;
    padding: 11px 12px;
    font-weight: 600;
}
.side-link i { font-size: 18px; width: 22px; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.is-active { background: rgba(20, 184, 166, .16); color: #99f6e4; }
.mobile-nav { background: #101b2d; color: #fff; }
.mobile-nav .btn-close { filter: invert(1); }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    background: rgba(244, 247, 251, .9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 15;
}
.topbar-title { font-weight: 700; color: #475569; }
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    display: grid;
    place-items: center;
}
.icon-btn:hover { border-color: #cbd5e1; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
}
.user-chip strong, .user-chip small { display: block; text-align: left; }
.user-chip small { color: var(--muted); font-weight: 600; }
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: grid;
    place-items: center;
    font-weight: 800;
}
.content { padding: 8px 28px 40px; }
.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 18px;
}
.page-head h1 { font-size: 30px; margin: 0; font-weight: 800; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.alert-app { border: 0; border-radius: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; padding: 16px; }
.stat-icon {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-dark); font-size: 20px;
}
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; font-weight: 600; }
.layout-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.panel-pad { padding: 18px; }
.panel h2 { font-size: 16px; margin: 0 0 14px; font-weight: 800; }
.chart-box { height: 260px; }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
    text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
    color: #64748b; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfb; }
.data-table a.row-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.data-table a.row-link:hover { color: var(--brand-dark); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.pill {
    display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px;
    font-size: 12px; font-weight: 700; background: #e2e8f0; color: #334155;
}
.pill-ok { background: #d1fae5; color: #065f46; }
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-danger { background: #ffe4e6; color: #9f1239; }
.pill-muted { background: #e2e8f0; color: #475569; }
.pill-role-superadmin { background: #ede9fe; color: #5b21b6; }
.pill-role-admin { background: #dbeafe; color: #1d4ed8; }
.pill-role-supervisor { background: #ffedd5; color: #9a3412; }
.pill-role-promoter { background: #ccfbf1; color: #115e59; }

.filter-bar { padding: 16px; margin-bottom: 16px; }
.filter-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 12px; }
.filter-grid .field span, .stack-label { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 6px; }
.filter-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
    background: var(--brand-soft); color: var(--brand-dark); text-decoration: none;
    border-radius: 999px; padding: 6px 10px; font-weight: 700; font-size: 13px;
}
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.pager-links { display: flex; gap: 6px; }
.pager-links a { text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--ink); background: #fff; }
.pager-links a.is-current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager-meta { color: var(--muted); font-size: 13px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state i { font-size: 36px; color: #94a3b8; }
.empty-state h2 { color: var(--ink); font-size: 20px; margin: 10px 0 6px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-tile { padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.form-tile h2 { font-size: 18px; margin: 0; }
.form-tile p { color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.link-code {
    font-family: Consolas, "Courier New", monospace; background: #f8fafc; border-radius: 8px;
    padding: 6px 8px; font-size: 13px; display: inline-block;
}
.rank-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.rank-row:last-child { border-bottom: 0; }
.bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.palette { position: sticky; top: 88px; padding: 16px; }
.palette h2 { font-size: 15px; }
.palette-group { margin-bottom: 14px; }
.palette-group strong { display: block; font-size: 12px; color: #64748b; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.add-field {
    width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px;
    padding: 8px 10px; margin-bottom: 6px; font-weight: 650; color: var(--ink);
}
.add-field:hover { border-color: #99f6e4; background: #f0fdfa; }
.field-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #fff; }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-row .form-control { flex: 1; }
.field-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.drag-handle { cursor: grab; color: #94a3b8; border: 0; background: transparent; }
.type-pill { background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 800; }
.builder-save {
    position: sticky; bottom: 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
    padding: 12px; border-radius: 14px; background: #102033; color: #fff;
}
.builder-save .btn-primary { background: #14b8a6; border-color: #14b8a6; color: #042f2e; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.answer { padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.answer:last-child { border-bottom: 0; }
.answer strong { display: block; margin-bottom: 4px; }
.meta-card { padding: 18px; }
.meta-card dl { margin: 0; }
.meta-card dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 12px; }
.meta-card dd { margin: 2px 0 0; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li:before {
    content: ""; position: absolute; left: 4px; top: 6px; bottom: 0; width: 2px; background: #dbe4ee;
}
.timeline li:last-child:before { display: none; }
.timeline li:after {
    content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
}
.timeline h3 { font-size: 16px; margin: 0 0 4px; }
.thumb { max-width: 220px; border-radius: 12px; border: 1px solid var(--line); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a {
    text-decoration: none; color: #334155; background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 14px;
}
.tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.qr-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.qr-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-align: center; background: #fff; break-inside: avoid; }
.qr-card .qr-slot { display: flex; justify-content: center; margin: 8px 0; }
.toast-note {
    position: fixed; bottom: 18px; right: 18px; background: #102033; color: #fff;
    padding: 12px 14px; border-radius: 12px; opacity: 0; transform: translateY(8px);
    transition: .2s ease; z-index: 50; pointer-events: none;
}
.toast-note.show { opacity: 1; transform: none; }
.demo-banner { background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.demo-banner code { background: #fff; padding: 2px 6px; border-radius: 6px; }

.auth-body { background: #e7f4f8; }
.public-body {
    background: #e8eef8; margin: 0; overflow-x: hidden;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-aside {
    padding: 56px; color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(45, 212, 191, .35), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(14, 165, 233, .25), transparent 28%),
        linear-gradient(160deg, #102033, #134e4a 80%);
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside h1 { font-size: 46px; font-weight: 800; line-height: 1.05; max-width: 520px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; }
.auth-points li { margin: 10px 0; font-size: 17px; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 6px; font-weight: 800; }
.install-card { width: min(640px, 100%); }

.pf-shell {
    --pf: #1d4ed8;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    background: #e8eef8;
}
.pf-shell.no-panel { grid-template-columns: 1fr; }
.pf-brand {
    color: #fff;
    padding: 28px 22px 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 80% 8%, rgba(255,255,255,.2), transparent 26%),
        linear-gradient(180deg, #4f9cf9 0%, var(--pf) 42%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
}
.pf-brand-bg {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%; object-fit: contain; object-position: center center;
}
.pf-brand.has-artwork {
    padding: 0;
    background: #dbe7f7;
}
.pf-logo, .pf-slogan, .pf-slogan-bar, .pf-art, .pf-highlights { position: relative; z-index: 1; }
.pf-logo {
    --logo-title: 26px;
    --logo-sub: 13px;
    --logo-gap: 2px;
    --logo-h: calc(var(--logo-title) + var(--logo-gap) + (var(--logo-sub) * 1.15));
    display: flex; align-items: center; gap: 12px;
}
.pf-logo.is-mark { --logo-h: 76px; }
.pf-logo-mark {
    height: var(--logo-h); min-width: var(--logo-h); width: auto; box-sizing: border-box;
    background: #fff; color: var(--logo-c, #facc15);
    display: flex; align-items: center; justify-content: center; flex: none;
    padding: 4px; border-radius: 10px; overflow: hidden;
    filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .55));
}
.pf-logo-mark svg, .pf-logo-mark img { height: 100%; width: auto; max-width: none; display: block; }
.logo-preview {
    width: 72px; height: 58px; margin-bottom: 8px; display: grid; place-items: center;
    background: #fff; border-radius: 12px; padding: 6px; border: 1px solid #dbe3f0;
    filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .35));
}
.logo-preview svg, .logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.pf-logo strong { display: block; width: fit-content; font-size: var(--logo-title); letter-spacing: .01em; color: var(--name-c, #facc15); line-height: 1; text-shadow: 0 4px 8px rgba(15, 23, 42, .45); }
.pf-logo strong.is-grad {
    position: relative; color: transparent; -webkit-text-fill-color: transparent; text-shadow: none;
    background-clip: text; -webkit-background-clip: text;
}
.pf-logo strong.is-grad::before {
    content: attr(data-text); position: absolute; left: 0; top: 0; z-index: -1;
    color: transparent; -webkit-text-fill-color: transparent;
    text-shadow: 0 6px 8px rgba(15, 23, 42, .55);
}
.name-preview {
    display: inline-block; margin: 8px 0 0; font-size: 22px; font-weight: 800; line-height: 1.1;
    letter-spacing: .01em; color: #facc15;
}
.panel-preview { display: block; width: 160px; height: auto; max-height: 280px; object-fit: contain; object-position: center; border-radius: 16px; margin-bottom: 10px; border: 1px solid #dbe3f0; background: #e8eef8; }
.pf-logo small { display: block; color: var(--tag-c, #fff); opacity: 1; font-size: var(--logo-sub); line-height: 1.15; margin-top: var(--logo-gap); text-shadow: 0 3px 6px rgba(15, 23, 42, .45); }
.pf-slogan { font-size: 28px; line-height: 1.12; font-weight: 800; margin: 22px 0 8px; max-width: 250px; }
.pf-slogan-bar { width: 72px; height: 6px; border-radius: 99px; background: #facc15; display: block; }
.pf-art {
    position: relative;
    flex: 1; min-height: 220px; margin: 8px 0 0;
    background: transparent;
}
.pf-plane { position: absolute; width: 54px; height: 54px; top: 10px; right: 18px; }
.pf-bulb { position: absolute; width: 46px; height: 46px; top: 28px; left: 54px; }
.pf-highlights {
    position: relative; z-index: 1;
    margin: -54px -22px 0;
    background: #fff;
    color: #0f172a;
    border-radius: 48% 48% 0 0 / 34px 34px 0 0;
    padding: 26px 8px 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.pf-highlight { text-align: center; }
.pf-highlight-ico {
    width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 6px;
    display: grid; place-items: center; padding: 11px;
}
.pf-highlight-ico svg { width: 100%; height: 100%; }
.pf-highlight-ico.tone-a { background: #ede9fe; color: #7c3aed; }
.pf-highlight-ico.tone-b { background: #dcfce7; color: #16a34a; }
.pf-highlight-ico.tone-c { background: #ffedd5; color: #ea580c; }
.pf-highlight strong, .pf-highlight small { display: block; }
.pf-highlight strong { font-size: 12px; }
.pf-highlight small { color: #64748b; font-size: 11px; line-height: 1.3; }
.pf-main { padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.pf {
    background: #fff; border-radius: 28px; box-shadow: 0 18px 50px rgba(30, 58, 138, .08);
    padding: 26px 28px 22px; width: 100%;
}
.pf-honeypot { position: absolute; left: -9999px; }
.pf-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.pf-title { display: flex; gap: 12px; min-width: 0; }
.pf-title-ico {
    width: 46px; height: 46px; border-radius: 14px; background: #eff6ff; color: var(--pf);
    display: grid; place-items: center; font-size: 22px; flex: none;
}
.pf-title h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; line-height: 1.15; color: var(--pf); }
.pf-title p { margin: 0; color: #64748b; font-size: 14px; line-height: 1.45; }
.pf-meta { display: flex; flex-direction: column; gap: 8px; flex: none; }
.pf-meta-card {
    display: flex; gap: 8px; align-items: center; background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 14px; padding: 8px 12px; min-width: 180px;
}
.pf-meta-ico {
    width: 32px; height: 32px; border-radius: 10px; background: #dbeafe; color: var(--pf);
    display: grid; place-items: center;
}
.pf-meta small { display: block; color: #64748b; font-size: 12px; }
.pf-meta strong { display: block; font-size: 14px; }
.pf-note {
    display: flex; align-items: center; gap: 8px; margin: 16px 0;
    background: #eff6ff; color: #1e3a8a; border-radius: 12px; padding: 8px 12px; font-size: 13px;
}
.req { color: #dc2626; margin-left: 3px; }
.pf-rows { display: flex; flex-direction: column; gap: 14px; }
.pf-row { display: grid; gap: 14px; }
.pf-row.cols-2 { grid-template-columns: 1fr 1fr; }
.pf-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.pf-label { display: block; font-size: 14px; font-weight: 750; margin-bottom: 6px; color: #0f172a; }
.pf-help, .pf-help-row { margin: -6px 0 0; color: #64748b; font-size: 13px; }
.pf-control {
    display: flex; align-items: center; gap: 8px; min-height: 48px;
    border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 4px 10px 4px 6px;
}
.pf-control.is-area { align-items: flex-start; padding-top: 8px; }
.pf-control:focus-within { border-color: var(--pf); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.pf-ico {
    width: 32px; height: 32px; border-radius: 9px; background: #eff6ff; color: var(--pf);
    display: grid; place-items: center; flex: none;
}
.pf-input, .pf-select {
    width: 100%; border: 0; background: transparent; padding: 8px 2px; font-size: 15px; color: #0f172a;
}
.pf-input, .pf-select, .pf-area, .pf-other, .pf-choice {
    text-transform: uppercase;
}
.pf-input::placeholder, .pf-area::placeholder, .pf-other::placeholder {
    text-transform: none;
}
.pf-input:focus, .pf-select:focus { outline: none; }
.pf-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 12px) 18px, calc(100% - 7px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.pf-area { min-height: 88px; resize: vertical; }
.pf-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pf-choice {
    display: flex; align-items: center; gap: 8px; min-height: 46px; margin: 0; min-width: 0;
    border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 10px; font-weight: 600; background: #fff;
    overflow-wrap: anywhere;
}
.pf-choice:has(input:checked) { border-color: var(--pf); background: #eff6ff; }
.pf-choice input { width: 16px; height: 16px; accent-color: var(--pf); flex: none; }
.pf-choice-ico { display: none; }
.pf-ok-mark { display: none; margin-left: auto; color: #16a34a; font-size: 18px; }
.pf-field.is-ok .pf-ok-mark { display: block; }
.pf-steps, .pf-nav, .pf-step-heading { display: none; }
.pf [hidden] { display: none !important; }
.pf-choice-other { grid-column: span 2; }
.pf-other { border: 0; border-bottom: 1px solid #cbd5e1; background: transparent; flex: 1; min-width: 0; padding: 4px 6px; }
.pf-other:focus { outline: none; border-bottom-color: var(--pf); }
.pf-file {
    display: flex; align-items: center; gap: 10px; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 14px; cursor: pointer;
}
.pf-file input { max-width: 100%; }
.pf-errors { background: #fff1f2; color: #9f1239; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.pf-errors ul { margin: 0; padding-left: 18px; }
.pf-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 22px; }
.pf-submit, .pf-clear {
    border-radius: 12px; min-height: 48px; padding: 10px 18px; font-weight: 800; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.pf-submit { background: var(--pf); color: #fff; border: 0; min-width: 220px; }
.pf-submit:disabled { opacity: .7; }
.pf-clear { background: #fff; color: #64748b; border: 1px solid #e2e8f0; }
.pf-lookup { margin: 6px 2px 0; font-size: 13px; color: #64748b; min-height: 1.2em; }
.pf-geo {
    margin-top: 8px; width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid #bfdbfe;
    background: #eff6ff; color: var(--pf, #1d4ed8); font-weight: 800; display: inline-flex;
    align-items: center; justify-content: center; gap: 8px;
}
.pf-geo:disabled { opacity: .7; }
.pf-lookup.is-ok { color: #0f766e; font-weight: 700; }
.pf-lookup.is-miss { color: #9f1239; }
.pf-lookup.is-wait { color: #0369a1; }
.pf-simple { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.pf-done { width: min(560px, 100%); background: #fff; border-radius: 24px; padding: 36px 24px; text-align: center; box-shadow: 0 18px 50px rgba(30, 58, 138, .08); }
.pf-done i { font-size: 48px; color: var(--pf, #1d4ed8); }
.preview-banner { background: #fef3c7; color: #92400e; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-weight: 700; }

@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 991px) {
    .sidebar { display: none; }
    .app-main { margin-left: 0; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
    .layout-2, .builder-layout, .detail-grid, .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .palette { position: static; }
    .user-chip-text { display: none; }
}
@media (max-width: 1100px) {
    .pf-shell { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
    .pf-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-slogan { font-size: 24px; max-width: none; }
    .pf-title h1 { font-size: 24px; }
    .pf-meta-card { min-width: 0; }
    .pf-main { padding: 16px; }
    .pf { padding: 22px 20px 18px; }
}
@media (max-width: 932px) {
    .stat-grid, .card-grid, .filter-grid, .qr-sheet { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: stretch; }
    .pf-shell { grid-template-columns: 1fr; }
    .pf-brand {
        min-height: 292px;
        padding: 14px 16px 72px;
        justify-content: flex-start;
    }
    .pf-brand.has-artwork {
        min-height: 0;
        padding: 0;
    }
    .pf-brand.has-artwork .pf-brand-bg {
        position: relative;
        display: block;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    .pf-brand-bg { object-position: center center; }
    .pf-logo { --logo-title: 22px; --logo-sub: 12px; }
    .pf-slogan, .pf-slogan-bar, .pf-note, .pf-title p { display: none; }
    .pf-highlights { display: none; }
    .pf-art {
        position: absolute; inset: 0; min-height: 0; margin: 0;
        pointer-events: none; z-index: 1;
    }
    .pf-plane { top: 10px; right: 14px; width: 34px; height: 34px; }
    .pf-bulb { top: 8px; right: 58px; left: auto; width: 28px; height: 28px; }
    .pf-main {
        position: relative; z-index: 2;
        margin-top: -36px;
        padding: 0 10px max(14px, env(safe-area-inset-bottom));
    }
    .pf {
        padding: 16px 14px 14px;
        border-radius: 22px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    }
    .pf-head { flex-direction: column; align-items: stretch; }
    .pf-steps {
        display: flex; list-style: none; margin: 2px 0 14px; padding: 0; width: 100%; order: 2;
    }
    .pf-title { order: 1; }
    .pf-meta { order: 3; }
    .pf-step { flex: 1; text-align: center; position: relative; }
    .pf-step-num {
        width: 28px; height: 28px; border-radius: 50%; border: 2px solid #cbd5e1;
        color: #94a3b8; background: #fff; display: inline-grid; place-items: center;
        font-weight: 800; font-size: 13px; position: relative; z-index: 1;
    }
    .pf-step.is-current .pf-step-num { background: var(--pf); border-color: var(--pf); color: #fff; }
    .pf-step.is-done .pf-step-num { border-color: var(--pf); color: var(--pf); background: #fff; }
    .pf-step small { display: block; margin-top: 6px; font-size: 11px; color: #94a3b8; line-height: 1.15; }
    .pf-step.is-current small, .pf-step.is-done small { color: #1e3a8a; font-weight: 800; }
    .pf-step-heading {
        display: block; margin: 0 0 12px; font-size: 18px; font-weight: 800; color: var(--pf);
    }
    .pf-step::before {
        content: ""; position: absolute; top: 14px; left: -50%; right: 50%;
        height: 2px; background: #e2e8f0;
    }
    .pf-step:first-child::before { display: none; }
    .pf-step.is-done::before, .pf-step.is-current::before { background: var(--pf); }
    .pf:not(.pf-ready):not(.pf-show-all) [data-step]:not([data-step="1"]),
    .pf-ready:not(.pf-show-all) [data-step].is-off { display: none !important; }
    .pf-title { align-items: flex-start; }
    .pf-title-ico { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
    .pf-title h1, .page-head h1 { font-size: 20px; overflow-wrap: anywhere; }
    .pf-title p { font-size: 13px; line-height: 1.4; }
    .pf-meta { flex-direction: row; width: 100%; gap: 8px; }
    .pf-meta-card { flex: 1; min-width: 0; width: auto; padding: 8px 8px; }
    .pf-meta strong { font-size: 13px; line-height: 1.2; }
    .pf-meta small { font-size: 11px; }
    .pf-row.cols-2, .pf-row.cols-3 { grid-template-columns: 1fr; }
    .pf-choices { display: flex; flex-direction: column; gap: 8px; }
    .pf-choice { width: 100%; min-width: 0; font-size: 15px; min-height: 50px; }
    .pf-choice-ico {
        display: grid; width: 28px; height: 28px; border-radius: 50%; place-items: center; flex: none; font-size: 14px;
    }
    .pf-choice-ico.tone-a { background: #dbeafe; color: #2563eb; }
    .pf-choice-ico.tone-b { background: #dcfce7; color: #16a34a; }
    .pf-choice-ico.tone-c { background: #f3e8ff; color: #7c3aed; }
    .pf-choice-other .pf-other { display: none; }
    .pf-choice-other:has(input:checked) .pf-other { display: block; }
    .pf-label, .pf-help, .pf-help-row { overflow-wrap: anywhere; }
    .pf-input, .pf-other, .pf-area { font-size: 16px; }
    .pf-file { flex-wrap: wrap; }
    .pf-actions { display: none; }
    .pf-nav { display: flex; gap: 10px; margin-top: 18px; }
    .pf-prev, .pf-next, .pf-nav .pf-submit {
        border-radius: 12px; min-height: 48px; padding: 10px 14px; font-weight: 800; font-size: 15px;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    }
    .pf-prev { flex: 0 0 42%; background: #fff; color: #64748b; border: 1px solid #e2e8f0; }
    .pf-next, .pf-nav .pf-submit { flex: 1; background: var(--pf); color: #fff; border: 0; min-width: 0; }
    .pf-nav .pf-submit, .pf.is-first .pf-prev { display: none; }
    .pf.is-last .pf-next { display: none; }
    .pf.is-last .pf-nav .pf-submit { display: inline-flex; }
    .pf.is-first .pf-next { flex: 1; }
    .pf-show-all .pf-steps, .pf-show-all .pf-nav { display: none !important; }
    .pf-show-all .pf-actions { display: flex !important; }
    .pf-show-all [data-step] { display: block !important; }
    .pf-show-all .pf-row { display: grid !important; }
    .pf-show-all .pf-meta { display: flex !important; }
    .pf:not(.pf-ready) .pf-prev, .pf:not(.pf-ready) .pf-nav .pf-submit { display: none; }
    .filter-actions { flex-direction: column; align-items: stretch; }
    .data-table { min-width: 640px; }
}
@media print {
    .sidebar, .topbar, .page-actions, .filter-bar, .no-print { display: none !important; }
    .app-main { margin: 0; }
    .content { padding: 0; }
    body { background: #fff; }
}
