/* ================= CreateBOL app styles (complete) ================= */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
       background: #f4f6fa; color: #111827; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: #2F6BFF; text-decoration: none; }
h1, h2, h3 { font-family: 'Montserrat', sans-serif; letter-spacing: -.02em; color: #0B1220; margin: .2em 0 .6em; }
h2 { font-size: 1.1rem; }
[hidden] { display: none !important; }

/* ----- Nav ----- */
.nav { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.5rem; background: #010F31; }
.brand img { height: 30px; width: auto; display: block; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav a, .nav .link { color: rgba(255,255,255,.8); }
.nav a:hover, .nav .link:hover { color: #fff; }
.nav a.btn.primary { color: #fff; }

/* ----- Layout ----- */
.container { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.container.wide { max-width: 1320px; }
.footer { text-align: center; color: #6b7280; padding: 2rem; font-size: .9rem; }
.card { background: #fff; border-radius: 12px; padding: 1.3rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 1.2rem; border: 1px solid #eef0f4; }
.narrow { max-width: 420px; margin: 2rem auto; }
.center { text-align: center; }
.muted { color: #6b7280; }
.small { font-size: .85rem; }
.mt { margin-top: 1rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 .8rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions { text-align: right; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin-top: 0; }
.section-title { font-size: 1.35rem; margin: 2rem 0 1rem; }

/* ----- Buttons ----- */
.btn { display: inline-block; padding: .55rem 1rem; border-radius: 8px; border: 1px solid #d1d5db; background: #fff;
       color: #111827; cursor: pointer; font: inherit; font-size: .95rem; transition: background .2s; }
.btn:hover { background: #f3f4f6; }
.btn.primary { background: #2F6BFF; border-color: #2F6BFF; color: #fff; }
.btn.primary:hover { background: #1F55E0; }
.btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.lg { padding: .8rem 1.5rem; font-size: 1.05rem; }
.btn.full { width: 100%; margin-top: .5rem; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.link { background: none; border: none; cursor: pointer; font: inherit; font-size: 1rem; padding: 0; }
.link-blue { color: #2F6BFF !important; }
.link-btn { background: none; border: 0; padding: 0; color: #2F6BFF; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.inline { display: inline; }

/* ----- Forms ----- */
label { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .8rem; }
input, select, textarea { width: 100%; padding: .55rem .65rem; margin-top: .3rem; border: 1px solid #d1d5db;
       border-radius: 7px; font: inherit; font-weight: 400; background: #fff; color: #111827; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #2F6BFF; }
input[type=checkbox] { width: auto; }
.alert { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.flash.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; margin: .6rem 0 0; }
.check input { width: auto; margin: 0; }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin-bottom: 0; flex: 1; min-width: 220px; }
.code-input { font-size: 1.4rem; letter-spacing: .5em; text-align: center; max-width: 240px; }
.verify-icon { font-size: 2.2rem; margin-bottom: .2rem; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; color: #6b7280; padding: .5rem; border-bottom: 2px solid #e5e7eb; }
td { padding: .45rem; border-bottom: 1px solid #f0f0f0; }
td.center { text-align: center; }
td.right { text-align: right; }
table.list tbody tr:hover { background: #f8faff; }
.card.flush { padding: .4rem .8rem; }
.items input, .items select { margin: 0; min-width: 70px; }
.items .wide { min-width: 240px; }
.remove-item, .remove-field { background: none; border: none; color: #dc2626; font-size: 1.1rem; cursor: pointer; padding: 0 .4rem; }

/* ----- Share / copy ----- */
.copy-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.copy-row input { flex: 1; min-width: 240px; margin: 0; background: #f9fafb; }
.copy-row form { display: inline; }
.pdf-frame { width: 100%; height: 80vh; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; margin-top: .5rem; }

/* ----- Custom fields ----- */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .5rem 0 1rem; font-size: .85rem; color: #6b7280; }
.chip { padding: .3rem .75rem; border-radius: 999px; border: 1px dashed #b6c2d9; background: #fff; color: #1F55E0; cursor: pointer; font: inherit; font-size: .82rem; }
.chip:hover { background: #eef3ff; }
.field-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.field-row input { margin: 0; }

/* ----- Signatures ----- */
.badge { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
         margin-left: .4rem; vertical-align: middle; font-family: 'Inter', sans-serif; letter-spacing: 0; }
.badge.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge.wait { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.sig-row { padding: 1rem 0; border-top: 1px solid #eef0f4; }
.sig-row:first-of-type { border-top: 0; }
.sig-row .copy-row { margin-top: .7rem; }
.banner-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; }
.sign-wrap { max-width: 860px; margin: 0 auto; }
.success { border-color: #a7f3d0; }
.sig-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: .2rem 0 .8rem; border-radius: 999px; background: #f3f4f6; border: 1px solid #e5e7eb; }
.sig-tab { border: 0; background: none; color: #4b5563; padding: .4rem 1.1rem; border-radius: 999px; cursor: pointer; font: inherit; }
.sig-tab.active { background: #2F6BFF; color: #fff; }
.pad-wrap { position: relative; background: #fff; border: 1px solid #d1d5db; border-radius: 10px; margin-bottom: .6rem; }
.pad-wrap::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 48px; border-bottom: 1px dashed #cbd5e1; pointer-events: none; }
#sig-pad { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; border-radius: 10px; }
.pad-hint { position: absolute; left: 24px; bottom: 54px; color: #94a3b8; font-size: .85rem; pointer-events: none; }
.pad-hint[hidden] { display: none; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 1.2rem 0; }
.consent input { width: auto; margin-top: .25rem; }

/* ----- Addresses / carriers ----- */
.two-col { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.2rem; align-items: start; }
.addr-list { display: grid; gap: .8rem; }
.addr-card { border: 1px solid #eef0f4; border-radius: 10px; padding: .9rem 1rem; display: flex; justify-content: space-between; gap: 1rem; }
.addr-card p { margin: .2rem 0 0; color: #4b5563; font-size: .9rem; }
.addr-actions { align-items: flex-start; flex-wrap: nowrap; }
.preset-select, .carrier-select { margin: 0 0 .9rem; background: #f8faff; border-color: #c7d6fb; }
.carrier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
.carrier-grid .span-2 { grid-column: 1 / -1; }
.carrier-grid input { min-width: 0; }
.optional-tag { font-family: 'Inter', sans-serif; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
                color: #6b7280; background: #f3f4f6; padding: .15rem .55rem; border-radius: 999px; vertical-align: middle; margin-left: .4rem; }

/* ----- Collapsible design panel ----- */
details.card > summary { cursor: pointer; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.1rem; color: #0B1220; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '+'; float: right; color: #2F6BFF; font-size: 1.3rem; line-height: 1; }
details.card[open] > summary { margin-bottom: 1rem; }
details.card[open] > summary::after { content: '–'; }
h3.mt { font-size: 1rem; }

/* ----- Template picker ----- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; margin-bottom: .5rem; }
.tpl-card { position: relative; display: block; border: 2px solid #e5e7eb; border-radius: 12px; padding: .6rem; cursor: pointer; margin: 0; background: #fff; transition: border-color .2s, box-shadow .2s; }
.tpl-card:hover { border-color: #c7d6fb; }
.tpl-card.selected { border-color: #2F6BFF; box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
.tpl-card.selected::after { content: '✓'; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: #2F6BFF; color: #fff; font-size: .8rem; display: grid; place-items: center; }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-name { display: block; font-weight: 700; color: #0B1220; margin-top: .5rem; }
.tpl-desc { display: block; font-size: .78rem; color: #6b7280; font-weight: 400; min-height: 2.3em; }
.tpl-thumb { display: block; height: 100px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; padding: 8px; overflow: hidden; }
.tpl-thumb b { display: block; height: 14px; margin-bottom: 8px; }
.tpl-thumb i { display: block; height: 6px; background: #e5e7eb; border-radius: 2px; margin-bottom: 5px; }
.tpl-thumb i.s { width: 60%; }
.tpl-thumb em { display: block; height: 8px; border-radius: 2px; margin: 8px 0 6px; }
.tpl-modern b { height: 24px; margin: -8px -8px 8px; background: #0B1F4D; }
.tpl-modern em { background: #0B1F4D; }
.tpl-classic b { border-bottom: 3px double #111; }
.tpl-classic em { background: #111; border-radius: 0; }
.tpl-minimal b { border-bottom: 1px solid #e5e7eb; }
.tpl-minimal em { background: none; border-bottom: 2px solid #111; border-radius: 0; }
.tpl-bold b { height: 24px; margin: -8px -8px 8px; background: #18181B; border-bottom: 4px solid #F59E0B; }
.tpl-bold em { background: #18181B; }
.tpl-corporate { border-left: 6px solid #0F766E; }
.tpl-corporate b { height: 6px; margin-top: 4px; background: linear-gradient(90deg, #0F766E 0 35%, transparent 35%); }
.tpl-corporate em { background: #0F766E; }

/* ----- Branding ----- */
.brand-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.brand-option { position: relative; display: flex; flex-direction: column; border: 2px solid #e5e7eb; border-radius: 10px; padding: .7rem .9rem; cursor: pointer; margin: 0; }
.brand-option.selected { border-color: #2F6BFF; background: #f5f8ff; }
.brand-option input { position: absolute; opacity: 0; pointer-events: none; }
.brand-option strong { color: #0B1220; }
.logo-current { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.logo-current img { max-height: 52px; max-width: 200px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px; background: #fff; }
.branding-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; align-items: start; }
.branding-grid .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* ----- Design panel + live preview ----- */
.design-grid { display: grid; grid-template-columns: 1.1fr 1fr .95fr; gap: 1.2rem; align-items: start; }
.design-col { margin-bottom: 0; }
.col-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.col-head h2 { margin: 0; }
.step { width: 28px; height: 28px; border-radius: 50%; background: #EAF0FF; color: #2F6BFF; font-weight: 700; font-size: .85rem; display: grid; place-items: center; flex-shrink: 0; }
.design-col .tpl-grid { grid-template-columns: repeat(2, 1fr); }
.design-col .brand-options { grid-template-columns: 1fr; }
.preview-col { position: sticky; top: 1rem; }
.pv-box { position: relative; border-radius: 10px; overflow: hidden; background: #eef1f6; border: 1px solid #e3e8f2;
          cursor: zoom-in; box-shadow: 0 10px 30px -18px rgba(1,15,49,.45); transition: transform .2s, box-shadow .2s; outline: none; }
.pv-box:hover, .pv-box:focus-visible { transform: translateY(-2px); box-shadow: 0 18px 40px -18px rgba(1,15,49,.55); }
.pv-box:focus-visible { outline: 3px solid rgba(47,107,255,.4); }
.pv-canvas canvas { display: block; width: 100%; height: auto; background: #fff; }
.pv-skeleton { aspect-ratio: 8.5 / 11; background: linear-gradient(90deg, #f1f4f9 25%, #e6ebf3 37%, #f1f4f9 63%); background-size: 400% 100%; animation: pvShimmer 1.4s ease infinite; }
@keyframes pvShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.pv-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 14px;
              background: linear-gradient(transparent 60%, rgba(1,15,49,.45)); opacity: 0; transition: opacity .2s; pointer-events: none; }
.pv-overlay span { background: #fff; color: #0B1220; font-weight: 600; font-size: .85rem; padding: .4rem .9rem; border-radius: 999px; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.pv-box:hover .pv-overlay, .pv-box:focus-visible .pv-overlay { opacity: 1; }
.pv-box.loading::after { content: ''; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
                         border: 2px solid rgba(47,107,255,.25); border-top-color: #2F6BFF; animation: pvSpin .8s linear infinite; }
@keyframes pvSpin { to { transform: rotate(360deg); } }
.pv-status { margin: .6rem 0 0; text-align: center; }
.pv-modal { position: fixed; inset: 0; z-index: 100; background: rgba(1,15,49,.82); backdrop-filter: blur(4px); overflow: auto; }
.pv-modal[hidden] { display: none; }
.pv-toolbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; align-items: center; gap: .5rem; padding: .8rem; }
.pv-toolbar button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #0B1220; font-size: 1.2rem; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.pv-toolbar button:hover { background: #EAF0FF; }
.pv-toolbar .pv-close { margin-left: 1rem; }
.pv-zoom { min-width: 60px; text-align: center; color: #fff; font-weight: 600; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 20px 40px; min-height: calc(100% - 64px); }
.pv-pages canvas { background: #fff; border-radius: 4px; box-shadow: 0 20px 50px rgba(0,0,0,.45); max-width: none; }

/* ----- Profile hero + tabs ----- */
.pf-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
           background: linear-gradient(135deg, #010F31, #0B1F4D 60%, #173a8a); color: #fff; border-radius: 16px; padding: 1.4rem 1.6rem;
           box-shadow: 0 16px 40px -24px rgba(1,15,49,.7); }
.pf-id { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #2F6BFF, #7FA6FF); color: #fff;
          font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.2rem; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.pf-hero h1 { color: #fff; margin: 0; font-size: 1.4rem; }
.pf-hero p { margin: .1rem 0 0; color: rgba(255,255,255,.7); font-size: .92rem; }
.pf-hero .btn.primary { background: #fff; border-color: #fff; color: #010F31; }
.pf-hero .btn.primary:hover { background: #EAF0FF; }
.pf-tabs { display: flex; gap: .35rem; padding: .35rem; margin: 1rem 0 1.5rem; background: #fff; border: 1px solid #e8ecf3;
           border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); overflow-x: auto; scrollbar-width: none; }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.05rem; border-radius: 10px; color: #4b5563;
          font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .2s, color .2s; }
.pf-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.pf-tab:hover { background: #f3f6fc; color: #0B1220; }
.pf-tab.active { background: #2F6BFF; color: #fff; box-shadow: 0 8px 18px -10px rgba(47,107,255,.9); }
.search-row { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-row input { flex: 1; min-width: 220px; margin: 0; }
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { padding: .35rem .75rem; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; color: #111827; }
.pager .current { background: #2F6BFF; border-color: #2F6BFF; color: #fff; }

/* ----- Account statistics ----- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid #eef0f4; border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kpi span { display: block; font-size: .82rem; color: #6b7280; }
.kpi strong { font-family: 'Montserrat', sans-serif; font-size: 1.8rem; color: #0B1220; line-height: 1.1; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.blue { background: #EAF0FF; color: #2F6BFF; }
.kpi-icon.purple { background: #F1EAFF; color: #7C3AED; }
.kpi-icon.green { background: #E7F8F0; color: #059669; }
.kpi-icon.amber { background: #FFF6E5; color: #D97706; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: #eef0f4; border: 1px solid #eef0f4; border-radius: 14px; overflow: hidden; margin-bottom: 1.2rem; }
.mini-kpis > div { background: #fff; padding: .9rem 1.2rem; }
.mini-kpis span { display: block; font-size: .78rem; color: #6b7280; }
.mini-kpis strong { font-size: 1.15rem; color: #0B1220; }
.stat-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat-grid > .card { margin-bottom: 1.2rem; }
.center-card { text-align: center; }
.bars { display: flex; gap: .8rem; align-items: flex-end; padding-top: .5rem; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.bar-track { width: 100%; height: 150px; background: #f3f6fc; border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-track i { display: block; width: 100%; min-height: 3px; background: linear-gradient(180deg, #5B8CFF, #2F6BFF); border-radius: 8px 8px 0 0; }
.bar-val { font-weight: 700; font-size: .85rem; color: #0B1220; }
.bar-label { font-size: .78rem; color: #6b7280; }
.ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; margin: .5rem auto 1rem; display: grid; place-items: center;
        background: conic-gradient(#2F6BFF calc(var(--p) * 1%), #e8edf7 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.ring span { position: relative; font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.8rem; color: #0B1220; }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid #f1f3f7; counter-increment: r; }
.rank li:last-child { border-bottom: 0; }
.rank li::before { content: counter(r); width: 24px; height: 24px; border-radius: 50%; background: #f3f6fc; color: #2F6BFF; font-size: .78rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.rank span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank b { color: #0B1220; }
.hbars { display: grid; gap: .7rem; }
.hbar { display: grid; grid-template-columns: 80px 1fr 28px; align-items: center; gap: .6rem; font-size: .88rem; }
.hbar-track { height: 10px; background: #f3f6fc; border-radius: 999px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: #2F6BFF; border-radius: 999px; }
.hbar b { text-align: right; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; padding: .7rem 0; border-bottom: 1px solid #f1f3f7; }
.activity li:last-child { border-bottom: 0; }
.activity .badge { margin-left: auto; }
.empty-mini { text-align: center; padding: 1rem 0; }

/* ----- Security ----- */
.sec-grid { display: grid; gap: 1.2rem; max-width: 880px; }
.sec-card { margin-bottom: 0; }
.sec-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.1rem; }
.sec-head h2 { margin: 0 0 .2rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sec-head p { margin: 0; }
.sec-icon { width: 44px; height: 44px; border-radius: 12px; background: #EAF0FF; color: #2F6BFF; display: grid; place-items: center; flex-shrink: 0; }
.sec-icon svg { width: 22px; height: 22px; }
.divider { height: 1px; background: #eef0f4; margin: 1.2rem 0; }
.field-label { display: block; font-size: .85rem; font-weight: 600; color: #374151; }
.current-email { font-size: 1.05rem; font-weight: 600; color: #0B1220; margin: .2rem 0 .9rem; }
.sec-links { display: flex; gap: 1.2rem; margin-top: .7rem; }
.status-pill { font-family: 'Inter', sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 999px; }
.status-pill.on { background: #E7F8F0; color: #047857; }
.status-pill.off { background: #f3f4f6; color: #6b7280; }
.pw-form { display: grid; grid-template-columns: 220px 1fr auto; gap: .8rem; align-items: end; }
.pw-form label { margin-bottom: 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 4rem; }
.pw-toggle { position: absolute; right: 6px; top: calc(50% + .15rem); transform: translateY(-50%); border: 0; background: #f3f6fc; color: #2F6BFF; font: inherit; font-size: .8rem; font-weight: 600; padding: .3rem .6rem; border-radius: 6px; cursor: pointer; }

/* ----- Movable sections + generate bar ----- */
.layout-hint { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
               background: #f5f8ff; border: 1px dashed #c7d6fb; border-radius: 10px; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .88rem; color: #374151; }
.mv { position: relative; margin-bottom: .4rem; transition: opacity .15s; }
.mv-bar { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; height: 24px; margin-bottom: 2px; opacity: .55; transition: opacity .15s; }
.mv:hover .mv-bar, .mv:focus-within .mv-bar { opacity: 1; }
.mv-handle { cursor: grab; user-select: none; font-size: .78rem; font-weight: 600; color: #4b5563; padding: .15rem .55rem; border-radius: 6px; background: #eef2f8; }
.mv-handle:active { cursor: grabbing; }
.mv-move { width: 26px; height: 22px; border: 0; border-radius: 6px; background: #eef2f8; color: #4b5563; cursor: pointer; font-size: .8rem; line-height: 1; padding: 0; }
.mv-move:hover { background: #dbe6ff; color: #2F6BFF; }
.mv:first-child [data-move="up"], .mv:last-child [data-move="down"] { visibility: hidden; }
.mv.dragging { opacity: .45; }
.mv.dragging > *:not(.mv-bar) { outline: 2px dashed #2F6BFF; outline-offset: 4px; border-radius: 12px; }
.mv .section-title { margin-top: .2rem; }
.generate-bar { position: sticky; bottom: 0; z-index: 20; margin: 1.5rem -1rem 0; padding: .9rem 1rem 1rem; background: linear-gradient(rgba(244,246,250,0), #f4f6fa 35%); }
.generate-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
                  background: #fff; border: 1px solid #e3e8f2; border-radius: 16px; padding: 1rem 1.2rem; box-shadow: 0 -6px 30px -12px rgba(1,15,49,.25); }
.generate-inner p { margin: 0; }
.btn-generate { font-size: 1.25rem; font-weight: 700; padding: 1.1rem 2.8rem; border-radius: 12px; min-width: 360px;
                text-align: center; box-shadow: 0 14px 30px -12px rgba(47,107,255,.85); transition: transform .15s, background .2s; }
.btn-generate:hover { transform: translateY(-1px); }
.toast { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); background: #0B1220; color: #fff;
         padding: .55rem 1.1rem; border-radius: 999px; font-size: .88rem; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

/* ----- Switches + compact option boxes ----- */
.switch { display: inline-flex; align-items: center; gap: .55rem; margin: 0; font-weight: 600; color: #374151; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; padding: 0; margin: 0; border: 0;
                border-radius: 999px; background: #d1d5db; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: #2F6BFF; }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 3px solid rgba(47,107,255,.35); }
.compact-card { padding: .7rem 1rem; }
.compact-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.compact-row .switch span { font-size: .92rem; }
.compact-input { flex: 1; min-width: 220px; }
.compact-input input { margin: 0; padding: .45rem .6rem; font-size: .9rem; }
.compact-row .btn { padding: .45rem .9rem; }
.option-row { display: flex; align-items: flex-start; gap: .7rem; margin: 0; font-weight: 400; cursor: pointer; }
.option-row input[type="checkbox"] { width: 18px; height: 18px; margin: .15rem 0 0; accent-color: #2F6BFF; flex-shrink: 0; cursor: pointer; }
.option-row strong { display: block; color: #0B1220; font-size: .95rem; }
.option-row .muted { display: block; }

/* ----- Anti-spam ----- */
.hp-field { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: .4rem 0 .9rem; }

/* ----- Responsive ----- */
@media (max-width: 1100px) {
  .design-grid { grid-template-columns: 1fr 1fr; }
  .preview-col { grid-column: 1 / -1; position: static; max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (max-width: 900px) {
  .stat-grid, .stat-grid.three, .branding-grid { grid-template-columns: 1fr; }
  .pw-form { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .addr-card { flex-direction: column; }
}
@media (max-width: 720px) {
  .design-grid { grid-template-columns: 1fr; }
  .pf-hero { padding: 1.1rem; }
  .pf-tab span { display: none; }
  .pf-tab { padding: .6rem .9rem; }
  .pf-tab.active span { display: inline; }
}
@media (max-width: 640px) {
  .btn-generate { min-width: 0; width: 100%; font-size: 1.1rem; }
  .generate-inner p { display: none; }
  .mv-bar { opacity: 1; }
}
@media (max-width: 600px) {
  .nav { padding: .8rem 1rem; }
  .nav-links { gap: .7rem; font-size: .9rem; }
  .field-row { grid-template-columns: 1fr auto; }
  .field-row input:first-child { grid-column: 1 / -1; }
  .pdf-frame { height: 60vh; }
}
@media (max-width: 420px) {
  .carrier-grid { grid-template-columns: 1fr; }
}

/* ===== v1.4: address autocomplete ===== */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; list-style: none; margin: 0; padding: .3rem;
           background: #fff; border: 1px solid #e3e8f2; border-radius: 10px; box-shadow: 0 16px 40px -16px rgba(1,15,49,.35); max-height: 300px; overflow: auto; }
.ac-item { display: flex; flex-direction: column; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; font-weight: 400; }
.ac-item strong { font-size: .9rem; color: #0B1220; font-weight: 600; }
.ac-item span { font-size: .8rem; color: #6b7280; }
.ac-item:hover, .ac-item.active { background: #f0f5ff; }
.ac-credit { font-size: .7rem; color: #9ca3af; text-align: right; padding: .3rem .6rem 0; font-weight: 400; }

/* ===== v1.4: theme toggle button ===== */
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: transparent;
                color: #fff; display: inline-grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s; flex-shrink: 0; }
.theme-toggle:hover { background: rgba(255,255,255,.1); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ===== v1.4: DARK MODE ===== */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] body { background: #0a0f1c; color: #e5e7eb; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] details.card > summary, [data-theme="dark"] .tpl-name, [data-theme="dark"] .brand-option strong,
[data-theme="dark"] .option-row strong, [data-theme="dark"] .current-email, [data-theme="dark"] .kpi strong,
[data-theme="dark"] .mini-kpis strong, [data-theme="dark"] .bar-val, [data-theme="dark"] .ring span, [data-theme="dark"] .rank b,
[data-theme="dark"] .addr-card strong, [data-theme="dark"] .ac-item strong { color: #f3f4f6; }
[data-theme="dark"] .pf-hero h1 { color: #fff; }
[data-theme="dark"] a { color: #7FA6FF; }
[data-theme="dark"] .nav { background: #050a18; border-bottom: 1px solid #1f2937; }
[data-theme="dark"] .nav a, [data-theme="dark"] .nav .link { color: rgba(255,255,255,.8); }
[data-theme="dark"] .nav a.btn.primary, [data-theme="dark"] .btn.primary { color: #fff; }
[data-theme="dark"] .muted, [data-theme="dark"] .tpl-desc, [data-theme="dark"] th, [data-theme="dark"] .kpi span,
[data-theme="dark"] .mini-kpis span, [data-theme="dark"] .bar-label, [data-theme="dark"] .addr-card p,
[data-theme="dark"] .chips, [data-theme="dark"] .footer, [data-theme="dark"] .ac-item span { color: #94a3b8; }
[data-theme="dark"] label, [data-theme="dark"] .field-label, [data-theme="dark"] .switch, [data-theme="dark"] .layout-hint { color: #cbd5e1; }

[data-theme="dark"] .card, [data-theme="dark"] .kpi, [data-theme="dark"] .mini-kpis > div, [data-theme="dark"] .pf-tabs,
[data-theme="dark"] .generate-inner, [data-theme="dark"] .pager a, [data-theme="dark"] .tpl-card, [data-theme="dark"] .brand-option,
[data-theme="dark"] .ac-list { background: #111827; border-color: #1f2937; }
[data-theme="dark"] .mini-kpis { background: #1f2937; border-color: #1f2937; }
[data-theme="dark"] .addr-card, [data-theme="dark"] .rank li, [data-theme="dark"] .activity li,
[data-theme="dark"] .sig-row, [data-theme="dark"] td { border-color: #1f2937; }
[data-theme="dark"] th { border-bottom-color: #374151; }
[data-theme="dark"] .divider { background: #1f2937; }
[data-theme="dark"] table.list tbody tr:hover { background: #162033; }

[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #0b1220; border-color: #374151; color: #f3f4f6; }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #64748b; }
[data-theme="dark"] select option { background: #111827; }
[data-theme="dark"] .copy-row input { background: #0b1220; }
[data-theme="dark"] .preset-select, [data-theme="dark"] .carrier-select { background: #0f1a33; border-color: #1e3a8a; }

[data-theme="dark"] .btn { background: #1f2937; border-color: #374151; color: #e5e7eb; }
[data-theme="dark"] .btn:hover { background: #273244; }
[data-theme="dark"] .btn.primary { background: #2F6BFF; border-color: #2F6BFF; }
[data-theme="dark"] .btn.primary:hover { background: #1F55E0; }
[data-theme="dark"] .btn.danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
[data-theme="dark"] .pf-hero .btn.primary { background: #fff; border-color: #fff; color: #010F31; }

[data-theme="dark"] .alert, [data-theme="dark"] .flash.error { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.4); color: #fecaca; }
[data-theme="dark"] .flash.success, [data-theme="dark"] .banner-ok { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.4); color: #a7f3d0; }
[data-theme="dark"] .badge.ok { background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.4); }
[data-theme="dark"] .badge.wait { background: rgba(251,191,36,.12); color: #fcd34d; border-color: rgba(251,191,36,.35); }
[data-theme="dark"] .status-pill.on { background: rgba(16,185,129,.15); color: #6ee7b7; }
[data-theme="dark"] .status-pill.off, [data-theme="dark"] .optional-tag { background: #1f2937; color: #94a3b8; }

[data-theme="dark"] .pf-tab { color: #9ca3af; }
[data-theme="dark"] .pf-tab:hover { background: #1f2937; color: #f3f4f6; }
[data-theme="dark"] .pf-tab.active { background: #2F6BFF; color: #fff; }
[data-theme="dark"] .bar-track, [data-theme="dark"] .hbar-track, [data-theme="dark"] .rank li::before { background: #1f2937; }
[data-theme="dark"] .ring { background: conic-gradient(#2F6BFF calc(var(--p) * 1%), #1f2937 0); }
[data-theme="dark"] .ring::before { background: #111827; }
[data-theme="dark"] .kpi-icon.blue, [data-theme="dark"] .sec-icon, [data-theme="dark"] .step { background: #172554; color: #93b4ff; }
[data-theme="dark"] .kpi-icon.purple { background: #2e1065; color: #c4b5fd; }
[data-theme="dark"] .kpi-icon.green { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .kpi-icon.amber { background: #451a03; color: #fcd34d; }

[data-theme="dark"] .tpl-card:hover { border-color: #1e3a8a; }
[data-theme="dark"] .tpl-card.selected, [data-theme="dark"] .brand-option.selected { border-color: #2F6BFF; }
[data-theme="dark"] .brand-option.selected { background: #0f1a33; }
[data-theme="dark"] .chip { background: transparent; color: #93b4ff; border-color: #334155; }
[data-theme="dark"] .chip:hover { background: #1f2937; }
[data-theme="dark"] .layout-hint { background: #0f1a33; border-color: #1e3a8a; }
[data-theme="dark"] .mv-handle, [data-theme="dark"] .mv-move { background: #1f2937; color: #9ca3af; }
[data-theme="dark"] .mv-move:hover { background: #1e3a8a; color: #fff; }
[data-theme="dark"] .generate-bar { background: linear-gradient(rgba(10,15,28,0), #0a0f1c 35%); }
[data-theme="dark"] .switch input { background: #4b5563; }
[data-theme="dark"] .switch input:checked { background: #2F6BFF; }
[data-theme="dark"] .sig-tabs { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .sig-tab { color: #cbd5e1; }
[data-theme="dark"] .sig-tab.active { background: #2F6BFF; color: #fff; }
[data-theme="dark"] .pv-box { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .pdf-frame { border-color: #374151; }
[data-theme="dark"] .pw-toggle { background: #1f2937; color: #93b4ff; }
[data-theme="dark"] .ac-item:hover, [data-theme="dark"] .ac-item.active { background: #1f2937; }
/* PDFs, document thumbnails and the signature pad intentionally stay white */