@import url("fonts/fonts.css");

:root {
    --configured-light-bg: #f5f4f1;
    --configured-dark-bg: #0f1519;
    --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-heading: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --bg: var(--configured-light-bg);
    --surface: #fff;
    --ink: #172027;
    --muted: #6d777f;
    --line: #e3e5e4;
    --primary: #d7352b;
    --primary-dark: #b9261e;
    --primary-soft: #fff0ed;
    --nav: #182126;
    --sidebar-bg-light: #fff;
    --sidebar-bg-dark: #182126;
    --menu-text-light: #47535b;
    --menu-text-dark: #aeb7ba;
    --menu-hover-light: #f0f3f4;
    --menu-hover-dark: #253137;
    --menu-hover-text-light: #172027;
    --menu-hover-text-dark: #fff;
    --menu-active-bg: #d7352b;
    --menu-active-text: #fff;
    --sidebar-bg: var(--sidebar-bg-light);
    --sidebar-text: var(--menu-text-light);
    --sidebar-hover: var(--menu-hover-light);
    --sidebar-hover-text: var(--menu-hover-text-light);
    --green: #167b55;
    --green-soft: #eaf7f1;
    --amber: #a86408;
    --amber-soft: #fff5dd;
    --blue: #2465a8;
    --blue-soft: #eaf3fb;
    --shadow: 0 14px 40px rgba(23, 32, 39, .07);
    --radius: 18px;
    font-family: var(--font-body);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
body.dialog-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand, .btn { font-family: var(--font-heading); }
h1 { letter-spacing: -.045em; }
input, textarea, select {
    width: 100%; border: 1px solid #d7dadb; border-radius: 11px; background: #fff; color: var(--ink);
    padding: 12px 13px; outline: 0; transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { resize: vertical; min-height: 88px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #59636b 50%), linear-gradient(135deg, #59636b 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, textarea:focus, select:focus { border-color: #e05d55; box-shadow: 0 0 0 4px rgba(215, 53, 43, .09); }
input:disabled { background: #f1f2f2; color: #8a9297; }
label { display: block; font-weight: 600; font-size: 13px; color: #303a41; }
label input, label textarea, label select { margin-top: 7px; font-weight: 400; }
label small, .form-hint { display: block; margin-top: 5px; font-weight: 400; font-size: 12px; color: var(--muted); }
hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 850; letter-spacing: -.9px; }
.brand-variant { display: none; max-width: 100%; align-items: center; gap: 10px; }
html[data-theme="light"] .brand-variant-light, html[data-theme="dark"] .brand-variant-dark { display: inline-flex; }
.brand-logo-image { display: block; width: auto; max-width: 174px; height: auto; max-height: 48px; object-fit: contain; }
.sidebar .brand-logo-image { max-width: 184px; max-height: 52px; }
.mobile-brand .brand-logo-image { max-width: 130px; max-height: 34px; }
.brand-word { display: inline-flex; align-items: baseline; line-height: 1; }
.brand em { color: var(--primary); font-style: normal; }
.brand-x { display: inline-block; margin: 0 1px; color: var(--primary); font-size: 1.18em; font-weight: 900; letter-spacing: -2px; transform: skew(-8deg); transform-origin: center; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 11px 4px 11px 4px; background: linear-gradient(145deg, #f24a3f, #c51f18); color: #fff; font-size: 20px; font-weight: 900; font-style: normal; line-height: 1; letter-spacing: -2px; transform: rotate(-3deg); box-shadow: 0 9px 22px rgba(215,53,43,.28); }
.brand-mark::after { content: ""; position: absolute; top: -15px; right: -7px; width: 13px; height: 66px; background: rgba(255,255,255,.18); transform: rotate(34deg); }
.brand-light .brand-x { color: #ff574e; }
.btn { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 11px; padding: 11px 18px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(215,53,43,.2); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: #283239; background: #fff; border: 1px solid #d8dcdd; }
.btn-secondary:hover, .btn-ghost:hover { background: #f7f8f8; }
.btn-ghost { color: #4b555c; background: transparent; border: 1px solid #dfe2e2; box-shadow: none; }
.btn-light { background: #fff; color: var(--primary-dark); box-shadow: 0 10px 28px rgba(76, 15, 11, .17); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-block { width: 100%; }
.required { color: var(--primary); }
.optional, .optional-text { color: #817564; background: #f5f0e8; border-radius: 99px; padding: 4px 9px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.optional-text { float: right; background: transparent; padding: 0; font-size: 9px; }
.eyebrow, .step-label { color: var(--primary); font-size: 10px; letter-spacing: 1.35px; font-weight: 800; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 255px; display: flex; flex-direction: column; border-right: 1px solid color-mix(in srgb, var(--sidebar-text) 13%, transparent); background: var(--sidebar-bg); color: var(--sidebar-text); padding: 26px 18px 18px; transition: background .22s, color .22s; }
.sidebar .brand { padding: 0 10px 24px; }
.workspace-pill { display: flex; align-items: center; gap: 10px; margin: 4px 3px 18px; padding: 10px; border: 1px solid color-mix(in srgb, var(--sidebar-text) 13%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--sidebar-text) 4%, transparent); min-width: 0; }
.company-avatar, .user-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #ebe5dc; color: #5f4c3d; font-weight: 800; }
.workspace-pill > span:last-child { min-width: 0; }
.workspace-pill small, .workspace-pill strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-pill small { color: color-mix(in srgb, var(--sidebar-text) 72%, transparent); font-size: 9px; text-transform: uppercase; letter-spacing: .6px; }
.workspace-pill strong { margin-top: 2px; font-size: 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.sidebar nav > a, .sidebar summary { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 10px 12px; border-radius: 10px; color: var(--sidebar-text); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.sidebar nav > a > span, .sidebar summary > span { display: inline-grid; place-items: center; width: 20px; font-size: 18px; color: currentColor; }
.sidebar nav a:hover, .sidebar summary:hover { color: var(--sidebar-hover-text); background: var(--sidebar-hover); }
.sidebar nav > a.active, .sidebar details a.active { color: var(--menu-active-text); background: var(--menu-active-bg); }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary b { margin-left: auto; font-weight: 400; transition: transform .2s; }
.sidebar details[open] summary b { transform: rotate(180deg); }
.sidebar details > div { display: grid; gap: 2px; margin: 2px 0 5px 42px; border-left: 1px solid color-mix(in srgb, var(--sidebar-text) 18%, transparent); padding-left: 9px; }
.sidebar details > div a { padding: 8px 11px; color: color-mix(in srgb, var(--sidebar-text) 82%, transparent); border-radius: 8px; font-size: 12px; }
.credit-badge { margin-left: auto; border-radius: 99px; background: color-mix(in srgb, var(--sidebar-text) 13%, transparent); padding: 2px 7px; color: inherit; font-size: 10px; }
.logout-form { margin-top: 10px; }
.nav-logout { display: flex; width: 100%; justify-content: space-between; border: 0; border-top: 1px solid color-mix(in srgb, var(--sidebar-text) 13%, transparent); padding: 17px 10px 5px; background: transparent; color: var(--sidebar-text); cursor: pointer; font-size: 12px; }
.main-area { min-height: 100vh; margin-left: 255px; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: flex-end; position: sticky; z-index: 20; top: 0; padding: 0 34px; background: rgba(245,244,241,.88); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(221,222,220,.78); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dedfdd; border-radius: 99px; padding: 6px 10px; background: #fff; color: var(--ink); cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.theme-toggle:hover { border-color: color-mix(in srgb, var(--primary) 45%, #dedfdd); transform: translateY(-1px); }
.theme-toggle span { font-size: 15px; line-height: 1; }
.theme-toggle small { color: var(--muted); font-size: 10px; font-weight: 700; }
.guest-theme-toggle { position: fixed; z-index: 15; top: 18px; right: 20px; background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(17,25,30,.1); backdrop-filter: blur(14px); }
.balance-chip { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid #dedfdd; border-radius: 99px; padding: 7px 12px; background: #fff; color: var(--muted); font-size: 11px; }
.balance-chip span { color: var(--ink); font-weight: 800; font-size: 13px; }
.user-avatar { width: 36px; height: 36px; font-size: 13px; }
.menu-toggle, .mobile-brand, .bottom-nav, .sidebar-scrim { display: none; }
.page-content { max-width: 1460px; margin: 0 auto; padding: 32px 38px 56px; }

.toast { position: fixed; z-index: 100; top: 20px; left: 50%; transform: translateX(-50%); min-width: min(430px, calc(100vw - 30px)); max-width: 600px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid #dfe3e2; border-radius: 12px; padding: 13px 15px; background: #fff; box-shadow: 0 16px 50px rgba(22,30,35,.18); font-size: 13px; }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--primary); }
.toast.info { border-left: 4px solid var(--blue); }
.toast button { border: 0; background: none; color: #7d878e; font-size: 20px; cursor: pointer; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin: 2px 0 26px; }
.page-head h1 { margin: 6px 0 4px; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; }
.page-head p { margin: 0; color: var(--muted); }
.content-card, .info-card { border: 1px solid #e4e5e3; border-radius: var(--radius); background: #fff; box-shadow: 0 10px 36px rgba(23,32,39,.035); padding: 24px; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-title h2 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.025em; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.section-title > a { color: var(--primary); font-weight: 700; font-size: 12px; }

.hero-card { position: relative; min-height: 235px; display: flex; align-items: center; overflow: hidden; border-radius: 22px; margin-bottom: 20px; padding: 38px 42px; color: #fff; background: radial-gradient(circle at 73% 30%, rgba(255,255,255,.12), transparent 27%), linear-gradient(135deg, #d5372d, #b82720); box-shadow: 0 18px 38px rgba(183,39,31,.16); }
.hero-card > div:first-child { position: relative; z-index: 2; max-width: 620px; }
.hero-kicker { font-size: 9px; font-weight: 800; letter-spacing: 1.5px; opacity: .74; }
.hero-card h2 { max-width: 570px; margin: 9px 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.17; letter-spacing: -.04em; }
.hero-card p { max-width: 560px; color: rgba(255,255,255,.74); font-size: 13px; }
.hero-art { position: absolute; right: 5%; top: 15px; width: 220px; height: 220px; opacity: .9; }
.sheet-one, .sheet-two { position: absolute; display: block; width: 118px; height: 158px; border: 1px solid rgba(255,255,255,.38); border-radius: 7px; background: rgba(255,255,255,.09); transform: rotate(10deg); right: 30px; top: 20px; }
.sheet-two { transform: rotate(-3deg); right: 68px; top: 31px; background: rgba(255,255,255,.13); }
.sheet-two::before, .sheet-two::after { content: ""; position: absolute; left: 18px; right: 18px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.45); top: 31px; box-shadow: 0 18px 0 rgba(255,255,255,.25), 0 36px 0 rgba(255,255,255,.25), 0 54px 0 rgba(255,255,255,.25); }
.seal { position: absolute; display: grid; place-items: center; right: 7px; bottom: 23px; width: 57px; height: 57px; border: 2px solid rgba(255,255,255,.6); border-radius: 50%; font-weight: 800; font-size: 12px; transform: rotate(9deg); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-grid article { display: flex; align-items: center; gap: 13px; min-width: 0; border: 1px solid #e4e5e3; border-radius: 15px; padding: 17px; background: #fff; }
.stat-grid article > div { min-width: 0; }
.stat-grid small, .stat-grid strong { display: block; }
.stat-grid small { color: var(--muted); font-size: 10px; }
.stat-grid strong { margin-top: 1px; font-size: 22px; line-height: 1.2; }
.stat-grid em, .stat-grid a { margin-left: auto; align-self: flex-start; color: var(--muted); font-size: 9px; font-style: normal; }
.stat-grid a { color: var(--primary); font-weight: 700; }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; font-size: 17px; }
.stat-icon.red { color: var(--primary); background: var(--primary-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 10px 12px; color: #7a8388; text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .7px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px 12px; border-bottom: 1px solid #eceeed; font-size: 12px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { max-width: 260px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.status { display: inline-flex; border-radius: 99px; padding: 4px 9px; font-size: 9px; font-weight: 800; }
.status.finalized { background: var(--green-soft); color: var(--green); }
.status.draft { background: var(--amber-soft); color: var(--amber); }
.icon-link { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #f4f5f5; color: var(--primary); font-weight: 800; }
.empty-state { display: flex; min-height: 260px; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; }
.empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 13px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); font-size: 23px; }
.empty-state h3 { margin: 0 0 4px; font-size: 16px; }
.empty-state p { color: var(--muted); font-size: 12px; }
.empty-state.compact { min-height: 150px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 20px; align-items: start; }
.stack-form { display: flex; flex-direction: column; gap: 17px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.form-actions { display: flex; justify-content: flex-end; padding-top: 3px; }
.settings-grid h3 { margin: 2px 0 -11px; font-size: 14px; }
.verified { color: var(--green); background: var(--green-soft); border-radius: 99px; padding: 5px 9px; font-size: 10px; font-weight: 800; }
.info-card { position: sticky; top: 92px; padding: 28px; }
.info-card .info-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 13px; margin-bottom: 16px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.info-card h3 { margin: 0 0 7px; }
.info-card > p { color: var(--muted); font-size: 12px; }
.info-card dl { margin: 22px 0 0; }
.info-card dl div { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 11px 0; font-size: 11px; }
.info-card dt { color: var(--muted); }
.info-card dd { margin: 0; font-weight: 700; }
.text-green { color: var(--green); }
.text-red { color: var(--primary); }
.logo-upload { display: flex; align-items: center; gap: 15px; border: 1px dashed #cfd4d4; border-radius: 13px; padding: 13px; cursor: pointer; }
.logo-preview { display: grid; place-items: center; width: 74px; height: 60px; flex: 0 0 74px; overflow: hidden; border-radius: 10px; background: #f0f1f0; color: #9aa1a5; font-size: 10px; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-upload strong, .logo-upload small { display: block; }
.logo-upload small { color: var(--muted); font-weight: 400; }
.logo-upload input { border: 0; margin: 7px 0 0; padding: 0; font-size: 11px; }
.bank-card { position: sticky; top: 92px; }
.security-note { display: flex; align-items: flex-start; gap: 9px; border-radius: 11px; padding: 11px 12px; color: #49655c; background: #eef6f2; font-size: 11px; }
.security-note span { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; }

.quote-builder { max-width: 1120px; margin: 0 auto; }
.builder-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.builder-head h1 { margin: 0 0 3px; font-size: 31px; }
.builder-head p { margin: 0; color: var(--muted); font-size: 12px; }
.builder-credit { text-align: right; border: 1px solid #e1e2e0; border-radius: 12px; background: #fff; padding: 9px 13px; }
.builder-credit small, .builder-credit strong { display: block; }
.builder-credit small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.builder-credit strong { font-size: 13px; }
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0 0 18px; padding: 0; list-style: none; }
.stepper li { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; color: #9ba2a5; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; z-index: -1; top: 16px; left: 35px; right: 6px; height: 1px; background: #d9dcdb; }
.stepper li > span { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border: 1px solid #d6d9d8; border-radius: 50%; background: var(--bg); font-size: 11px; font-weight: 800; }
.stepper strong, .stepper small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper strong { color: #879094; font-size: 10px; }
.stepper small { font-size: 8px; }
.stepper li.active > span, .stepper li.complete > span { border-color: var(--primary); background: var(--primary); color: #fff; }
.stepper li.active strong, .stepper li.complete strong { color: var(--ink); }
.stepper li.complete:not(:last-child)::after { background: var(--primary); }
.builder-card { min-height: 570px; border: 1px solid #e1e3e1; border-radius: 21px; background: #fff; box-shadow: var(--shadow); }
.wizard-panel { display: none; padding: 37px 42px 29px; }
.wizard-panel.active { display: block; animation: panelIn .25s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel-heading { position: relative; margin-bottom: 27px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 5px 0 3px; font-size: 23px; letter-spacing: -.04em; }
.panel-heading p { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; }
.panel-heading > .optional { position: absolute; top: 9px; right: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 20px; }
.span-2 { grid-column: span 2; }
.number-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 7px; }
.number-field input { margin: 0; text-transform: uppercase; }
.number-field .btn { min-height: 43px; white-space: nowrap; }
.wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 31px; padding-top: 20px; border-top: 1px solid var(--line); }
.wizard-actions > div { display: flex; gap: 8px; }
.quote-items { display: grid; gap: 10px; }
.quote-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto 32px 32px; align-items: center; gap: 10px; border: 1px solid #e1e4e3; border-radius: 13px; padding: 13px; transition: border .15s, box-shadow .15s; }
.quote-item:hover { border-color: #c8cdcc; box-shadow: 0 7px 20px rgba(24,33,38,.05); }
.quote-item-index { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.quote-item-main { min-width: 0; }
.quote-item-main strong, .quote-item-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-item-main small { color: var(--muted); font-size: 10px; }
.quote-item-meta { text-align: right; }
.quote-item-meta small, .quote-item-meta strong { display: block; }
.quote-item-meta small { color: var(--muted); font-size: 9px; }
.quote-item button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #e1e4e3; border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; }
.quote-item button:hover { color: var(--primary); border-color: #edb6b2; }
.add-dashed { display: flex; width: 100%; min-height: 100px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px dashed #cbd0cf; border-radius: 14px; margin-top: 13px; background: #fbfbfa; color: var(--muted); cursor: pointer; }
.add-dashed:hover { border-color: var(--primary); background: #fff8f7; color: var(--primary); }
.add-dashed > span { font-size: 22px; line-height: 1; }
.add-dashed strong { font-size: 12px; }
.add-dashed small { font-size: 10px; }
.line-editor { display: grid; gap: 9px; }
.line-row { display: grid; grid-template-columns: 32px 1fr 32px; align-items: start; gap: 9px; }
.line-row > span { display: grid; place-items: center; height: 40px; border-radius: 9px; background: #f2f3f2; color: var(--muted); font-weight: 800; font-size: 11px; }
.line-row textarea { min-height: 65px; margin: 0; }
.line-row button { display: grid; place-items: center; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #90979a; cursor: pointer; font-size: 18px; }
.line-row button:hover { color: var(--primary); background: var(--primary-soft); }
.add-line { border: 0; margin: 13px 0 0 41px; padding: 0; background: none; color: var(--primary); font-size: 12px; font-weight: 800; cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-card { position: relative; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #dfe2e1; border-radius: 15px; padding: 20px; text-align: center; cursor: pointer; transition: border .15s, background .15s, transform .15s; }
.choice-card:hover { transform: translateY(-2px); border-color: #e6a39f; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border: 2px solid var(--primary); background: #fff8f7; }
.choice-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 11px; background: #f1f3f2; color: #59646b; font-size: 19px; }
.choice-card:has(input:checked) .choice-icon { background: var(--primary-soft); color: var(--primary); }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { color: var(--muted); font-weight: 400; }
.choice-card i { position: absolute; top: 12px; right: 12px; display: none; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-style: normal; }
.choice-card:has(input:checked) i { display: grid; }
.company-summary { display: flex; align-items: center; gap: 12px; border: 1px solid #e0e3e2; border-radius: 13px; margin-top: 15px; padding: 12px; }
.company-summary > span:first-child { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 10px; background: #f1f2f1; overflow: hidden; }
.company-summary .summary-logo img { width: 100%; height: 100%; object-fit: contain; }
.company-summary div { min-width: 0; }
.company-summary small, .company-summary strong, .company-summary div > span { display: block; }
.company-summary small, .company-summary div > span { color: var(--muted); font-size: 10px; }
.company-summary a { margin-left: auto; color: var(--primary); font-size: 11px; font-weight: 800; }
.company-summary.missing { border-color: #efd5a8; background: #fffaf0; }
.company-summary.missing > span:first-child { color: var(--amber); background: var(--amber-soft); font-weight: 800; }
.subsection-title { margin: 0 0 10px; font-size: 14px; }
.theme-configurator { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 23px; }
.theme-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.theme-heading h3 { margin: 3px 0 2px; font-size: 19px; }
.theme-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.theme-count { flex: 0 0 auto; border-radius: 999px; padding: 6px 9px; background: #f1f3f2; color: var(--muted); font-size: 9px; font-weight: 800; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-card { position: relative; display: grid; grid-template-columns: 108px 1fr; min-height: 102px; align-items: center; gap: 13px; border: 1px solid #dfe2e1; border-radius: 14px; padding: 12px; cursor: pointer; transition: border .15s, transform .15s, box-shadow .15s; }
.theme-card:hover { transform: translateY(-2px); border-color: #c9cecc; box-shadow: 0 8px 22px rgba(19,28,33,.06); }
.theme-card > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:checked) { border: 2px solid var(--primary); padding: 11px; background: #fffafa; }
.theme-mini { position: relative; display: block; width: 108px; height: 76px; overflow: hidden; border: 1px solid #dadedd; border-radius: 7px; background: #fff; box-shadow: 0 4px 10px rgba(20,28,32,.08); }
.theme-mini i, .theme-mini b, .theme-mini em, .theme-mini u { position: absolute; display: block; text-decoration: none; }
.theme-card-ribbon .theme-mini i { inset: 0 38px 49px 0; border-radius: 0 0 22px; background: var(--mini-primary); }
.theme-card-ribbon .theme-mini b { top: 9px; right: 8px; width: 27px; height: 5px; background: var(--mini-secondary); }
.theme-card-ribbon .theme-mini em { top: 36px; right: 8px; left: 8px; height: 8px; background: var(--mini-primary); }
.theme-card-ribbon .theme-mini u { top: 49px; right: 8px; left: 8px; height: 18px; background: repeating-linear-gradient(#eee 0 4px,#fff 4px 8px); }
.theme-card-column .theme-mini i { top: 0; bottom: 0; left: 8px; width: 24px; background: var(--mini-primary); }
.theme-card-column .theme-mini b { top: 11px; right: 8px; width: 31px; height: 7px; background: var(--mini-secondary); }
.theme-card-column .theme-mini em { top: 33px; right: 8px; left: 39px; height: 7px; background: var(--mini-secondary); }
.theme-card-column .theme-mini u { top: 45px; right: 8px; left: 39px; height: 22px; background: repeating-linear-gradient(#eee 0 4px,#fff 4px 8px); }
.theme-card-executive .theme-mini i { top: 0; right: 0; left: 0; height: 21px; border-bottom: 3px solid var(--mini-primary); background: var(--mini-secondary); }
.theme-card-executive .theme-mini b { top: 33px; right: 29px; left: 8px; height: 7px; background: var(--mini-secondary); }
.theme-card-executive .theme-mini em { top: 33px; right: 8px; width: 19px; height: 34px; background: var(--mini-primary); }
.theme-card-executive .theme-mini u { top: 43px; right: 29px; left: 8px; height: 24px; background: repeating-linear-gradient(#eee 0 6px,#ddd 6px 12px); }
.theme-card-prestige .theme-mini i { top: 0; right: 0; left: 0; height: 28px; border-bottom: 4px solid var(--mini-primary); background: var(--mini-secondary); }
.theme-card-prestige .theme-mini b { top: 36px; right: 8px; left: 8px; height: 8px; background: var(--mini-primary); }
.theme-card-prestige .theme-mini em { top: 44px; right: 8px; left: 8px; height: 24px; border: 1px solid #d9dddc; background: repeating-linear-gradient(#fff 0 7px,#f2f2f2 7px 14px); }
.theme-card-prestige .theme-mini u { right: 0; bottom: 0; left: 0; height: 5px; background: var(--mini-secondary); }
.theme-card-copy { min-width: 0; }
.theme-card-copy strong, .theme-card-copy small { display: block; }
.theme-card-copy strong { margin-bottom: 3px; font-size: 12px; }
.theme-card-copy small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.theme-check { position: absolute; top: 8px; right: 8px; display: none; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 9px; font-weight: 800; }
.theme-card:has(input:checked) .theme-check { display: grid; }
.color-editor { display: grid; grid-template-columns: 1fr 145px 145px auto; align-items: end; gap: 12px; border-radius: 13px; margin-top: 13px; padding: 14px; background: #f6f7f6; }
.color-editor > div strong, .color-editor > div small, .color-editor label > span:first-child { display: block; }
.color-editor > div strong { font-size: 12px; }
.color-editor > div small { color: var(--muted); font-size: 9px; }
.color-editor label > span:first-child { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.color-input { display: grid; grid-template-columns: 35px 1fr; align-items: center; overflow: hidden; border: 1px solid #dadddc; border-radius: 9px; background: #fff; }
.color-input input { width: 35px; height: 34px; border: 0; border-radius: 0; padding: 2px; background: transparent; cursor: pointer; }
.color-input b { padding: 0 8px; color: #555f64; font-size: 9px; font-weight: 700; }
.btn-small { min-height: 36px; padding: 8px 11px; font-size: 10px; }
.currency-warning { display: flex; align-items: flex-start; gap: 13px; border: 1px solid #f0d39b; border-radius: 13px; margin-bottom: 15px; padding: 14px; background: #fffbf0; }
.currency-warning > span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.currency-warning > div { display: grid; width: 100%; grid-template-columns: 1fr 150px; column-gap: 15px; align-items: center; }
.currency-warning strong, .currency-warning p { grid-column: 1; }
.currency-warning p { margin: 2px 0 0; color: #77664c; font-size: 11px; }
.currency-warning label { grid-column: 2; grid-row: 1 / 3; font-size: 10px; }
.currency-warning select { margin-top: 4px; padding: 8px 10px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; border: 1px solid #e2e5e4; border-radius: 11px 11px 0 0; padding: 9px 13px; background: #f7f8f7; color: var(--muted); font-size: 10px; }
.preview-toolbar span { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.preview-toolbar i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.preview-toolbar button { border: 0; background: none; color: var(--muted); font-size: 9px; }
.paper-wrap { max-height: 680px; overflow: auto; border: 1px solid #e2e5e4; border-top: 0; padding: 28px; background: #e9e9e6; }
.preview-document { display: flex; min-width: min-content; flex-direction: column; align-items: center; gap: 24px; }
.preview-page-frame { width: 690px; flex: 0 0 auto; }
.quote-paper { position: relative; width: 100%; max-width: 760px; min-height: 980px; overflow: hidden; margin: 0 auto; padding: 58px 56px; background: #fff; box-shadow: 0 12px 32px rgba(23,32,39,.12); color: #172027; font-family: Arial, sans-serif; }
.paper-content { position: relative; z-index: 1; }
.watermark { position: absolute; z-index: 4; top: 50%; left: 50%; width: 142%; color: rgba(215,53,43,.15); text-align: center; font-family: Inter, Arial, sans-serif; font-size: 104px; font-weight: 900; letter-spacing: -5px; line-height: 1; white-space: nowrap; pointer-events: none; user-select: none; transform: translate(-50%, -50%) rotate(-34deg); transform-origin: center; }
.watermark.removed { display: none; }
.preview-brand-header { display: grid; grid-template-columns: 38% 1fr 12px; min-height: 112px; align-items: center; margin: -58px -56px 25px; padding-left: 56px; border-bottom: 7px solid #ffb30b; background: #202020; }
.preview-brand-header > i { align-self: stretch; background: #ffb30b; }
.preview-firm-logo { display: grid; place-items: center; width: 112px; height: 64px; overflow: hidden; border: 2px solid #ffb30b; border-radius: 4px; color: #ffb30b; font-family: Georgia, serif; font-size: 30px; font-weight: 800; }
.preview-firm-logo img { width: 100%; height: 100%; padding: 6px; object-fit: contain; background: #fff; }
.preview-firm-info { padding: 15px 15px 15px 0; text-align: right; color: #d7d7d7; font-size: 7px; }
.preview-firm-info strong, .preview-firm-info span, .preview-firm-info small { display: block; }
.preview-firm-info strong { color: #fff; font-size: 13px; margin-bottom: 4px; }
.preview-firm-info small { margin-top: 3px; color: #ffbd31; }
.preview-letter-section { margin-bottom: 25px; }
.preview-letter-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.preview-recipient { padding: 17px 4px 6px 0; }
.preview-recipient > b { display: block; color: #e99e00; font-size: 8px; letter-spacing: .7px; }
.preview-recipient > strong { display: block; margin-top: 4px; color: #202020; font-size: 15px; line-height: 1.25; }
.preview-recipient > small { display: block; margin-top: 2px; color: #858585; font-size: 7px; }
.preview-recipient > div { margin-top: 14px; }
.preview-recipient div small, .preview-recipient div strong { display: block; }
.preview-recipient div small { color: #777; font-size: 7px; font-weight: 700; }
.preview-recipient div strong { margin-top: 2px; font-size: 8.5px; }
.preview-recipient .subject { border-left: 3px solid #ffb30b; padding: 8px 10px; background: #f1f1f1; }
.preview-offer-card { border-left: 1px solid #e1e1e1; padding-left: 21px; }
.preview-offer-card > small { color: #8a8a8a; font-size: 7px; font-weight: 800; letter-spacing: 1.8px; }
.preview-offer-card h2 { margin: 1px 0 10px; color: #ffb30b; font-size: 23px; line-height: .96; }
.preview-offer-card dl { display: grid; grid-template-columns: 47% 1fr; margin: 0; font-size: 7.5px; }
.preview-offer-card dt, .preview-offer-card dd { margin: 0; padding: 3px 0; }
.preview-offer-card dt { color: #606060; }
.preview-offer-card dd { color: #202020; font-weight: 800; }
.preview-offer-card em { display: block; color: #df9700; font-size: 6px; font-style: normal; text-transform: uppercase; }
.preview-document-section { margin-top: 23px; }
.preview-section-title { display: flex; align-items: center; margin-bottom: 11px; border-bottom: 1px solid #ccd4d9; }
.preview-section-title > span { display: grid; place-items: center; width: 34px; height: 25px; flex: 0 0 34px; border-radius: 14px; background: #ffb30b; color: #202020; font-size: 7px; font-weight: 800; }
.preview-section-title h3 { margin: 0; padding: 0 0 5px 10px; color: #202020; font-size: 13px; }
.preview-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; font-size: 7.7px; }
.preview-table th { padding: 8px 5px; background: #ffb30b; color: #fff; text-align: left; font-size: 6.5px; }
.preview-table th:first-child { border-radius: 15px 0 0 15px; }
.preview-table th:last-child { border-radius: 0 15px 15px 0; }
.preview-table td { padding: 8px 6px; vertical-align: top; }
.preview-table tbody tr:nth-child(even) td { background: #ececec; }
.preview-table tbody tr:nth-child(even) td:first-child { border-radius: 14px 0 0 14px; }
.preview-table tbody tr:nth-child(even) td:last-child { border-radius: 0 14px 14px 0; }
.preview-table th:not(:nth-child(2)), .preview-table td:not(:nth-child(2)) { white-space: nowrap; text-align: right; }
.preview-table th:first-child, .preview-table td:first-child { width: 25px; text-align: center; }
.preview-table th:first-child { color: #fff; }
.preview-table td:first-child { color: #666; }
.preview-table td small { display: block; color: #80878b; font-size: 6.5px; }
.preview-totals { width: 47%; margin: 17px 0 0 auto; font-size: 8px; }
.preview-totals div { display: flex; justify-content: space-between; padding: 4px 11px; }
.preview-totals .grand { margin-top: 4px; border-radius: 18px; padding: 9px 12px; color: #fff; background: #ffb30b; font-size: 10px; font-weight: 800; }
.preview-detail-list > div { display: grid; grid-template-columns: 30px 1fr; border-bottom: 1px solid #e2e7e9; padding: 7px 4px; font-size: 8px; }
.preview-detail-list > div { border: 0; }
.preview-detail-list > div:nth-child(even) { border-radius: 14px; background: #eee; }
.preview-detail-list span { color: #d99100; text-align: center; font-size: 7px; font-weight: 800; }
.preview-detail-list p { margin: 0; padding-right: 7px; color: #303030; }
.preview-bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preview-bank-grid > div { border-top: 3px solid #ffb30b; padding: 9px 11px; background: #f1f1f1; }
.preview-bank-grid small, .preview-bank-grid strong { display: block; }
.preview-bank-grid small { color: #777; font-size: 6.5px; font-weight: 700; }
.preview-bank-grid strong { color: #202020; font-size: 8px; margin-top: 3px; }
.preview-signature { display: grid; grid-template-columns: 1fr 1fr; margin-top: 28px; border-top: 1px solid #d7dee2; padding-top: 14px; font-size: 7px; }
.preview-signature > div:last-child { text-align: right; }
.preview-signature small, .preview-signature strong { display: block; }
.preview-signature small { color: #d99100; font-weight: 800; }
.preview-signature strong { color: #202020; font-size: 8px; }
.preview-signature > div:last-child span { display: block; width: 150px; height: 28px; margin-left: auto; border-bottom: 1px solid #8f9aa1; }
.preview-footer { position: absolute; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 1fr 130px; min-height: 46px; align-items: center; background: #202020; color: #fff; font-size: 7px; }
.preview-footer span { padding: 0 56px; }
.preview-footer strong { display: grid; height: 100%; place-items: center; background: #ffb30b; color: #202020; }
.quote-paper[class*="preview-theme-"] { --tpl-primary: #0d6efd; --tpl-secondary: #000000; padding: 42px 38px 64px; color: #282b2e; font-size: 8px; }
.tpl-logo { display: grid; width: 92px; height: 48px; flex: 0 0 92px; place-items: center; overflow: hidden; border: 2px solid var(--tpl-primary); border-radius: 3px; color: var(--tpl-primary); font-family: Georgia, serif; font-size: 24px; font-weight: 800; }
.tpl-logo img { width: 100%; height: 100%; padding: 4px; object-fit: contain; background: #fff; }
.tpl-ribbon-top { display: grid; grid-template-columns: 61% 39%; min-height: 96px; align-items: center; margin: -42px -38px 0; }
.tpl-ribbon-top > div { display: flex; height: 100%; align-items: center; gap: 10px; padding: 14px 25px 14px 38px; border-radius: 0 0 45px; background: var(--tpl-primary); color: #fff; }
.tpl-ribbon-top p, .tpl-ribbon-top strong, .tpl-ribbon-top small { display: block; margin: 0; }
.tpl-ribbon-top p { min-width: 0; }
.tpl-ribbon-top strong { font-size: 11px; }
.tpl-ribbon-top small { margin-top: 3px; font-size: 5.5px; }
.tpl-ribbon-top h1 { margin: 0; padding-right: 38px; color: var(--tpl-secondary); text-align: right; font-size: 29px; }
.tpl-ribbon-info { display: grid; grid-template-columns: 55% 45%; gap: 25px; margin: 19px 0 17px; padding: 0 10px; }
.tpl-ribbon-info b, .tpl-ribbon-info > div > strong, .tpl-ribbon-info > div > small { display: block; }
.tpl-ribbon-info b { color: var(--tpl-primary); font-size: 6.5px; }
.tpl-ribbon-info > div > strong { margin-top: 4px; color: var(--tpl-secondary); font-size: 13px; }
.tpl-ribbon-info > div > small { margin-top: 3px; color: #72777a; }
.tpl-ribbon-info p { border-left: 3px solid var(--tpl-primary); margin: 11px 0 0; padding: 6px 9px; background: #f3f3f3; }
.tpl-ribbon-info p span { display: block; color: var(--tpl-primary); font-size: 5.5px; font-weight: 800; }
.tpl-ribbon-info dl { display: grid; grid-template-columns: 1fr 1fr; align-content: start; margin: 0; }
.tpl-ribbon-info dt, .tpl-ribbon-info dd { margin: 0; padding: 3px 0; }
.tpl-ribbon-info dt { color: #74787b; }
.tpl-ribbon-info dd { color: var(--tpl-secondary); text-align: right; font-weight: 800; }
.tpl-ribbon-info em, .tpl-column-meta em, .tpl-executive-meta em, .tpl-prestige-top em { display: block; color: var(--tpl-primary); font-size: 5.5px; font-style: normal; text-transform: uppercase; }
.tpl-column-header { display: grid; grid-template-columns: 22% 78%; min-height: 205px; margin-bottom: 14px; }
.tpl-column-header aside { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 10px; background: var(--tpl-primary); color: #fff; text-align: center; }
.tpl-column-header aside strong { font-size: 10px; }
.tpl-column-header main { padding-left: 22px; }
.tpl-column-header main > h1 { border-bottom: 2px solid var(--tpl-secondary); margin: 0 0 12px; padding: 7px 0 12px; color: var(--tpl-secondary); text-align: right; font-size: 21px; }
.tpl-column-header main > h1 b { color: var(--tpl-primary); }
.tpl-column-meta, .tpl-column-parties { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.tpl-column-meta p, .tpl-column-parties p { margin: 0; }
.tpl-column-meta small, .tpl-column-meta strong, .tpl-column-parties b, .tpl-column-parties strong, .tpl-column-parties small { display: block; }
.tpl-column-meta small, .tpl-column-parties b { color: #82878a; font-size: 5.5px; }
.tpl-column-meta strong, .tpl-column-parties strong { margin-top: 2px; color: var(--tpl-secondary); font-size: 6.7px; }
.tpl-column-parties { margin-top: 13px; }
.tpl-column-parties small { margin-top: 2px; color: #6e7376; font-size: 5.5px; }
.tpl-subject { border-left: 4px solid var(--tpl-primary); margin-top: 11px; padding: 6px 8px; background: #f2f3f3; }
.tpl-subject small, .tpl-subject strong { display: block; }
.tpl-subject small { color: #777c7f; font-size: 5.5px; }
.tpl-subject strong { margin-top: 2px; color: var(--tpl-secondary); font-size: 6.8px; }
.tpl-executive-top { display: flex; min-height: 82px; align-items: center; justify-content: space-between; margin: -42px -38px 14px; border-bottom: 5px solid var(--tpl-primary); padding: 0 38px; background: var(--tpl-secondary); color: #fff; }
.tpl-executive-top > div { display: flex; align-items: center; gap: 9px; }
.tpl-executive-top > div > strong { max-width: 170px; font-size: 10px; }
.tpl-executive-top h1 { margin: 0; font-size: 22px; letter-spacing: 1.4px; }
.tpl-executive-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; margin-bottom: 12px; }
.tpl-executive-parties p { margin: 0; }
.tpl-executive-parties p:last-child { text-align: right; }
.tpl-executive-parties b, .tpl-executive-parties strong, .tpl-executive-parties small { display: block; }
.tpl-executive-parties b { color: var(--tpl-primary); font-size: 6px; }
.tpl-executive-parties strong { margin-top: 3px; color: var(--tpl-secondary); font-size: 9.5px; }
.tpl-executive-parties small { margin-top: 2px; color: #6b7073; font-size: 5.8px; }
.tpl-executive-meta { display: grid; grid-template-columns: 18% 18% 18% 46%; margin-bottom: 15px; }
.tpl-executive-meta p { min-height: 42px; border-right: 3px solid #fff; margin: 0; padding: 7px 8px; background: var(--tpl-secondary); color: #fff; }
.tpl-executive-meta p:nth-child(2) { background: var(--tpl-primary); }
.tpl-executive-meta small, .tpl-executive-meta strong { display: block; }
.tpl-executive-meta small { opacity: .8; font-size: 5.3px; }
.tpl-executive-meta strong { margin-top: 2px; font-size: 6.5px; }
.tpl-prestige-top { display: grid; grid-template-columns: 61% 39%; min-height: 112px; margin: -42px -38px 14px; border-bottom: 8px solid var(--tpl-primary); background: var(--tpl-secondary); color: #fff; }
.tpl-prestige-top > div { display: flex; align-items: center; gap: 10px; padding: 17px 14px 17px 38px; }
.tpl-prestige-top > div p, .tpl-prestige-top > div strong, .tpl-prestige-top > div small { display: block; margin: 0; }
.tpl-prestige-top > div strong { font-size: 10.5px; }
.tpl-prestige-top > div small { margin-top: 3px; color: #d3d7d9; font-size: 5.5px; }
.tpl-prestige-top aside { border-left: 11px solid var(--tpl-primary); padding: 13px 38px 13px 17px; }
.tpl-prestige-top h1 { margin: 0 0 5px; color: var(--tpl-primary); font-size: 22px; }
.tpl-prestige-top dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; font-size: 5.7px; }
.tpl-prestige-top dt, .tpl-prestige-top dd { margin: 0; padding: 2px 0; }
.tpl-prestige-top dt { color: #d0d4d6; }
.tpl-prestige-top dd { text-align: right; font-weight: 800; }
.tpl-prestige-info { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 15px; }
.tpl-prestige-info p { margin: 0; }
.tpl-prestige-info b, .tpl-prestige-info strong, .tpl-prestige-info small, .tpl-prestige-info span, .tpl-prestige-info i { display: block; }
.tpl-prestige-info b { color: var(--tpl-primary); font-size: 6px; }
.tpl-prestige-info strong { margin-top: 3px; color: var(--tpl-secondary); font-size: 10.5px; }
.tpl-prestige-info small { margin-top: 3px; color: #686d70; font-size: 5.8px; }
.tpl-prestige-info span { margin-top: 7px; color: var(--tpl-secondary); }
.tpl-prestige-info i { color: var(--tpl-primary); font-size: 5.5px; font-style: normal; font-weight: 800; }
.template-document-section { margin-top: 16px; }
.template-section-title { display: flex; align-items: center; margin-bottom: 8px; border-bottom: 1px solid #d5d8d9; }
.template-section-title > span { display: grid; width: 30px; height: 22px; flex: 0 0 30px; place-items: center; background: var(--tpl-primary); color: #fff; font-size: 6.5px; font-weight: 800; }
.preview-theme-ribbon .template-section-title > span { border-radius: 12px; }
.preview-theme-column .template-section-title > span { background: var(--tpl-secondary); }
.template-section-title h3 { margin: 0; padding: 0 0 4px 8px; color: var(--tpl-secondary); font-size: 11px; }
.template-items-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 6.8px; }
.template-items-table .c-no { width: 5%; }
.template-items-table .c-description { width: 45%; }
.template-items-table .c-quantity { width: 9%; }
.template-items-table .c-price { width: 15%; }
.template-items-table .c-vat { width: 7%; }
.template-items-table .c-total { width: 19%; }
.template-items-table th { padding: 7px 4px; background: var(--tpl-primary); color: #fff; text-align: left; font-size: 6px; white-space: nowrap; }
.template-items-table th:first-child { text-align: center; }
.template-items-table th:nth-child(3) { text-align: center; }
.template-items-table th:nth-child(4) { text-align: right; }
.template-items-table th:nth-child(5) { text-align: center; }
.template-items-table th:nth-child(6) { text-align: right; }
.template-items-table td { border-bottom: 1px solid #e0e2e3; padding: 5px 4px; vertical-align: middle; }
.template-items-table tbody tr:nth-child(even) td { background: #f0f1f2; }
.template-items-table td:not(:nth-child(2)) { white-space: nowrap; text-align: right; }
.template-items-table td:first-child { color: #777b7e; text-align: center; }
.template-items-table td:nth-child(3), .template-items-table td:nth-child(5) { text-align: center; }
.template-items-table td small { display: block; margin-top: 2px; color: #85898c; font-size: 5.5px; }
.template-items-table td:nth-child(3) small { display: inline; margin-left: 2px; }
.template-items-table td:last-child { color: var(--tpl-secondary); font-weight: 800; }
.preview-theme-ribbon .template-items-table th:first-child { border-radius: 12px 0 0 12px; }
.preview-theme-ribbon .template-items-table th:last-child { border-radius: 0 12px 12px 0; }
.preview-theme-column .template-items-table th { background: var(--tpl-secondary); }
.preview-theme-column .template-items-table th:last-child { background: var(--tpl-primary); }
.preview-theme-executive .template-items-table th { background: var(--tpl-secondary); }
.preview-theme-executive .template-items-table th:first-child, .preview-theme-executive .template-items-table th:nth-child(2), .preview-theme-executive .template-items-table th:last-child { background: var(--tpl-primary); }
.preview-theme-executive .template-items-table td:last-child { background: var(--tpl-primary); color: #fff; }
.preview-theme-prestige .template-items-table { border: 1px solid #dadee0; }
.preview-theme-prestige .template-items-table td { border-right: 1px solid #e0e2e3; }
.template-totals { width: 42%; margin: 11px 0 0 auto; }
.template-totals div { display: flex; justify-content: space-between; padding: 4px 9px; }
.template-totals span { color: #6e7275; }
.template-totals strong { color: var(--tpl-secondary); }
.template-totals .grand { padding: 8px 9px; background: var(--tpl-primary); color: #fff; }
.template-totals .grand span, .template-totals .grand strong { color: #fff; }
.preview-theme-ribbon .template-totals .grand { border-radius: 14px; }
.preview-theme-executive .template-totals { border-right: 6px solid var(--tpl-primary); padding-right: 4px; }
.preview-theme-prestige .template-totals { width: 100%; }
.template-detail-list > div { display: grid; grid-template-columns: 28px 1fr; padding: 5px 6px; }
.template-detail-list > div:nth-child(even) { background: #f0f1f2; }
.template-detail-list span { color: var(--tpl-primary); text-align: center; font-size: 6px; font-weight: 800; }
.template-detail-list p { margin: 0; color: #33373a; }
.template-bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.template-bank-grid > div { border-top: 3px solid var(--tpl-primary); padding: 7px 9px; background: #f3f4f4; }
.template-bank-grid small, .template-bank-grid strong { display: block; }
.template-bank-grid small { color: #7b7f82; font-size: 5.7px; font-weight: 700; }
.template-bank-grid strong { margin-top: 2px; color: var(--tpl-secondary); font-size: 7px; }
.template-signature { display: grid; grid-template-columns: 1fr 1fr; margin-top: 20px; border-top: 1px solid #d5d8d9; padding-top: 10px; }
.template-signature > div:last-child { text-align: right; }
.template-signature small, .template-signature strong { display: block; }
.template-signature small { color: var(--tpl-primary); font-size: 5.8px; font-weight: 800; }
.template-signature strong { margin-top: 3px; color: var(--tpl-secondary); font-size: 7.5px; }
.template-signature span { display: block; width: 140px; height: 25px; margin-left: auto; border-bottom: 1px solid #8c9092; }
.template-footer { position: absolute; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 1fr 120px; min-height: 45px; align-items: center; border-top: 4px solid var(--tpl-primary); color: var(--tpl-secondary); font-size: 6.5px; }
.template-footer span { padding-left: 38px; }
.template-footer strong { display: grid; height: 100%; place-items: center; background: var(--tpl-primary); color: #fff; }
.preview-theme-column .template-footer, .preview-theme-executive .template-footer, .preview-theme-prestige .template-footer { border: 0; background: var(--tpl-secondary); color: #fff; }

.theme-card-hiza .theme-mini i { top: 7px; left: 8px; width: 34px; height: 12px; border-bottom: 3px solid #10b8b0; background: #fff; }
.theme-card-hiza .theme-mini b { top: 7px; right: 12px; width: 25px; height: 5px; border-left: 2px solid var(--mini-primary); background: #202020; }
.theme-card-hiza .theme-mini em { top: 30px; right: 7px; left: 7px; height: 8px; background: var(--mini-primary); }
.theme-card-hiza .theme-mini u { top: 42px; right: 7px; left: 7px; height: 25px; background: repeating-linear-gradient(#fff 0 6px,#e8e8e8 6px 7px); }
.theme-card-minimal .theme-mini i { top: 8px; left: 8px; width: 34px; height: 15px; border: 3px solid #777; border-right: 0; border-radius: 14px 0 0 14px; }
.theme-card-minimal .theme-mini b { top: 9px; right: 8px; width: 27px; height: 8px; border-bottom: 2px solid #777; background: #fff; }
.theme-card-minimal .theme-mini em { top: 37px; right: 8px; left: 8px; height: 1px; background: #aaa; }
.theme-card-minimal .theme-mini u { top: 46px; right: 8px; left: 8px; height: 18px; border-bottom: 1px solid #aaa; background: linear-gradient(90deg,#fff 0 42%,#f3f3f3 42%); }

.quote-paper.preview-theme-hiza, .quote-paper.preview-theme-minimal { width: 690px; max-width: none; height: 976px; min-height: 976px; padding: 0; color: var(--tpl-secondary); font-family: Arial, sans-serif; font-size: 10px; }
.quote-paper.preview-theme-hiza .paper-content, .quote-paper.preview-theme-minimal .paper-content { min-height: 976px; }
.ref-logo { display: grid; width: 100px; height: 38px; place-items: center; overflow: hidden; color: var(--tpl-primary); font-size: 24px; font-weight: 800; }
.ref-logo img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.ref-hiza-header { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 34px; height: 252px; margin: 49px 49px 15px; }
.ref-hiza-company { min-width: 0; padding-right: 14px; }
.ref-hiza-company > strong, .ref-hiza-company > p { display: block; }
.ref-hiza-company > strong { margin-top: 15px; font-size: 13px; }
.ref-hiza-company > p { max-width: 235px; margin: 9px 0 0; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; word-break: break-word; }
.ref-hiza-client { position: relative; min-width: 0; border-left: 4px solid var(--tpl-primary); padding-left: 27px; }
.ref-hiza-client h1 { margin: 3px 0 0; font-size: 19px; line-height: 1; }
.ref-hiza-client > small { display: block; margin-top: 4px; font-size: 7px; }
.ref-hiza-client h2 { margin: 8px 0 3px; font-size: 12px; }
.ref-hiza-client > p { max-width: 265px; min-height: 41px; margin: 0; font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
.ref-hiza-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 11px; }
.ref-hiza-dates span, .ref-hiza-dates b { display: block; }
.ref-hiza-dates b { margin-bottom: 5px; font-size: 8px; }
.ref-hiza-dates span { font-size: 10px; }
.ref-hiza-subject { margin-top: 12px; border-left: 3px solid var(--tpl-primary); border-radius: 0 5px 5px 0; padding: 6px 8px; background: #f2f6fb; }
.ref-hiza-subject b, .ref-hiza-subject span { display: block; }
.ref-hiza-subject b { margin-bottom: 2px; color: var(--tpl-primary); font-size: 7px; letter-spacing: .45px; }
.ref-hiza-subject span { overflow: hidden; font-size: 9px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ref-hiza-continuation { display: flex; height: 58px; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--tpl-primary); margin: 31px 49px 15px; }
.ref-hiza-continuation > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.ref-hiza-continuation .ref-logo { width: 77px; height: 27px; flex: 0 0 77px; font-size: 21px; }
.ref-hiza-continuation > div > strong { max-width: 245px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ref-hiza-continuation > p { margin: 0; text-align: right; }
.ref-hiza-continuation > p b, .ref-hiza-continuation > p span, .ref-hiza-continuation > p small { display: block; }
.ref-hiza-continuation > p b { font-size: 15px; }
.ref-hiza-continuation > p span { font-size: 7px; }
.ref-hiza-continuation > p small { max-width: 220px; overflow: hidden; color: #666; font-size: 6px; text-overflow: ellipsis; white-space: nowrap; }
.ref-hiza-watermark { position: absolute; z-index: -1; top: 405px; left: 95px; width: 500px; height: 155px; opacity: .055; }
.ref-hiza-watermark .ref-logo { width: 100%; height: 100%; font-size: 95px; }
.ref-hiza-table { position: relative; width: calc(100% - 98px); margin: 0 49px; border-collapse: collapse; table-layout: fixed; font-size: 9px; }
.ref-hiza-table th { height: 26px; padding: 6px 4px; background: var(--tpl-primary); color: #fff; text-align: left; font-size: 9px; white-space: nowrap; }
.ref-hiza-table th:not(:first-child) { text-align: center; }
.ref-hiza-table td { height: 38px; border-bottom: 1px solid #e9e9e9; padding: 7px 5px; vertical-align: top; line-height: 1.25; }
.ref-hiza-table td:first-child strong, .ref-hiza-table td small { display: block; }
.ref-hiza-table td:first-child strong { font-size: 9px; }
.ref-hiza-table td small { margin-top: 3px; color: #666; font-size: 7px; font-style: italic; }
.ref-hiza-table td:not(:first-child) { text-align: center; }
.ref-hiza-table td:not(:first-child) { white-space: nowrap; }
.ref-hiza-table td:last-child { text-align: right; white-space: nowrap; }
.ref-hiza-lower { margin: 19px 52px 62px; }
.ref-hiza-table + .ref-hiza-lower { margin-top: 19px; }
.ref-hiza-totals-row { min-height: 120px; }
.ref-section-title { display: grid; grid-template-columns: 14px max-content minmax(25px, 1fr); align-items: center; gap: 8px; margin: 0 0 10px; }
.ref-section-title i { height: 3px; background: var(--tpl-primary); }
.ref-section-title strong { font-size: 11px; letter-spacing: .1px; white-space: nowrap; }
.ref-section-title span { height: 1px; background: #b8c4d3; }
.ref-section-title i, .ref-section-title span { margin-bottom: 0; }
.ref-detail-block, .ref-finance-grid { margin-top: 19px; }
.ref-detail-block p { margin: 0 0 4px; font-size: 10px; line-height: 1.28; }
.ref-finance-grid { display: grid; grid-template-columns: 1fr; }
.ref-finance-grid.has-bank { grid-template-columns: 1fr 1fr; gap: 28px; }
.ref-finance-grid > .ref-detail-block { margin-top: 0; }
.ref-bank { border: 1px solid #d7dde4; padding: 10px 11px; background: #f7f9fb; }
.ref-bank strong, .ref-bank span { display: block; font-size: 8px; }
.ref-bank strong { margin-bottom: 4px; font-size: 9px; }
.ref-bank span { margin-top: 2px; }
.ref-hiza-totals { width: 46%; margin-left: auto; }
.ref-hiza-totals p { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #ccc; margin: 0; padding: 7px 3px; font-size: 11px; }
.ref-hiza-totals p span, .ref-hiza-totals p strong { text-align: right; }
.ref-hiza-totals p.grand { border-bottom: 0; font-size: 13px; font-weight: 800; }
.ref-page-footer { position: absolute; right: 0; bottom: 28px; left: 0; text-align: center; font-size: 9px; font-style: italic; }

.ref-minimal-header { display: grid; grid-template-columns: 342px 198px; gap: 86px; height: 450px; margin: 32px 32px 0; color: var(--tpl-primary); }
.ref-minimal-company { min-width: 0; padding-right: 12px; }
.ref-minimal-company .ref-logo { width: 158px; height: 74px; color: var(--tpl-primary); font-size: 34px; }
.ref-minimal-company > strong { display: block; margin-top: 18px; font-size: 11px; line-height: 1.45; }
.ref-minimal-company > p { max-width: 320px; margin: 4px 0 0; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; word-break: break-word; }
.ref-minimal-client { min-width: 0; }
.ref-minimal-client h1 { border-bottom: 4px solid var(--tpl-primary); margin: 18px 0 0; padding-bottom: 21px; text-align: right; font-size: 31px; line-height: 1; }
.ref-minimal-client > small { display: block; margin-top: 4px; color: var(--tpl-secondary); text-align: right; font-size: 7px; }
.ref-minimal-customer { border-bottom: 1px solid #aaa; margin-top: 22px; padding-bottom: 7px; }
.ref-minimal-customer b, .ref-minimal-customer p { display: block; margin: 0; }
.ref-minimal-customer b { font-size: 10px; }
.ref-minimal-customer p { margin-top: 3px; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.ref-minimal-client dl { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #aaa; margin: 18px 0 0; padding-bottom: 17px; font-size: 10px; }
.ref-minimal-client dt, .ref-minimal-client dd { margin: 0; font-weight: 800; }
.ref-minimal-client dd { color: var(--tpl-secondary); text-align: right; }
.ref-minimal-client > em { display: block; margin-top: 17px; text-align: right; font-size: 10px; font-style: normal; }
.ref-minimal-client > em b { display: block; color: var(--tpl-secondary); }
.ref-minimal-subject { margin-top: 14px; border-left: 3px solid var(--tpl-secondary); padding: 6px 8px; background: #f3f1f2; text-align: left; }
.ref-minimal-subject b, .ref-minimal-subject span { display: block; }
.ref-minimal-subject b { margin-bottom: 2px; color: var(--tpl-secondary); font-size: 7px; letter-spacing: .45px; }
.ref-minimal-subject span { font-size: 9px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ref-minimal-continuation { display: flex; height: 58px; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--tpl-primary); margin: 32px 32px 17px; color: var(--tpl-primary); }
.ref-minimal-continuation > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.ref-minimal-continuation .ref-logo { width: 82px; height: 30px; flex: 0 0 82px; color: var(--tpl-primary); font-size: 21px; }
.ref-minimal-continuation > div > strong { max-width: 260px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ref-minimal-continuation > p { margin: 0; text-align: right; }
.ref-minimal-continuation > p b, .ref-minimal-continuation > p span, .ref-minimal-continuation > p small { display: block; }
.ref-minimal-continuation > p b { font-size: 16px; }
.ref-minimal-continuation > p span { color: var(--tpl-secondary); font-size: 7px; }
.ref-minimal-continuation > p small { max-width: 230px; overflow: hidden; color: #777; font-size: 6px; text-overflow: ellipsis; white-space: nowrap; }
.ref-minimal-table { width: calc(100% - 64px); margin: 0 32px; border-collapse: collapse; table-layout: fixed; color: var(--tpl-primary); font-size: 10px; }
.ref-minimal-table th { border-bottom: 1px solid #aaa; padding: 0 5px 11px; text-align: left; }
.ref-minimal-table th:not(:first-child), .ref-minimal-table td:not(:first-child) { text-align: right; }
.ref-minimal-table th:nth-child(4), .ref-minimal-table td:nth-child(4) { text-align: center; }
.ref-minimal-table th:first-child, .ref-minimal-table td:first-child { padding-left: 0; padding-right: 9px; }
.ref-minimal-table th:last-child, .ref-minimal-table td:last-child { padding-right: 0; }
.ref-minimal-table td { height: 63px; border-bottom: 1px solid #aaa; padding: 13px 5px; vertical-align: top; font-family: "Courier New", monospace; font-size: 10px; }
.ref-minimal-lower { margin: 27px 32px 60px; color: var(--tpl-primary); }
.ref-minimal-totals-row { min-height: 120px; }
.ref-minimal-lower .ref-section-title i { background: var(--tpl-secondary); }
.ref-minimal-lower .ref-section-title span { background: #c3bec0; }
.ref-minimal-lower .ref-section-title strong { color: var(--tpl-primary); }
.ref-minimal-lower .ref-detail-block p { margin-bottom: 9px; line-height: 1.4; }
.ref-minimal-lower .ref-bank { border-color: #aaa; background: #f7f7f7; }
.ref-minimal-totals { width: 40%; margin-left: auto; }
.ref-minimal-totals p { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 0 0 16px; font-size: 10px; }
.ref-minimal-totals p b { color: var(--tpl-secondary); }
.ref-minimal-totals p span { text-align: right; font-family: "Courier New", monospace; }
.ref-minimal-totals p:last-child b { color: var(--tpl-primary); }
.ref-minimal-footer { position: absolute; right: 32px; bottom: 23px; left: 32px; display: flex; justify-content: space-between; color: #777; font-size: 8px; }
.preview-actions { display: flex; justify-content: flex-end; gap: 9px; border: 1px solid #e2e5e4; border-top: 0; border-radius: 0 0 11px 11px; padding: 13px; }
.preview-back { margin-top: 15px; border-top: 0; padding-top: 0; }

.app-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 30px); border: 0; border-radius: 18px; padding: 0; background: transparent; box-shadow: 0 25px 80px rgba(15,21,25,.3); }
.app-dialog::backdrop { background: rgba(16,23,27,.58); backdrop-filter: blur(3px); }
.dialog-card { position: relative; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 30px); overflow-y: auto; border-radius: 18px; padding: 27px; background: #fff; }
.dialog-card.compact { width: 100%; max-width: 440px; margin: 0 auto; align-items: center; text-align: center; padding: 33px 30px 28px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 21px; }
.dialog-head button, .dialog-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f2f3f3; color: #6c757a; font-size: 20px; cursor: pointer; }
.dialog-x { position: absolute; top: 15px; right: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.dialog-card.compact .dialog-actions { width: 100%; }
.dialog-card.compact .dialog-actions > * { flex: 1; }
.custom-vat[hidden] { display: none; }
.custom-vat { margin-top: 7px; }
.unit-rule { display: flex; align-items: flex-start; gap: 10px; border-radius: 11px; padding: 11px; background: var(--blue-soft); color: #3f5f7a; }
.unit-rule span { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; }
.unit-rule p { margin: 0; font-size: 11px; }
.confirm-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); font-size: 27px; font-weight: 800; }
.confirm-icon.warning { color: var(--amber); background: var(--amber-soft); }
.confirm-icon.success { color: var(--green); background: var(--green-soft); }
.dialog-card.compact h2 { margin: 0; font-size: 22px; }
.dialog-card.compact > p { margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.balance-line { display: flex; width: 100%; justify-content: space-between; border-radius: 10px; padding: 11px 13px; background: #f3f5f4; font-size: 12px; }
.share-url { display: flex; width: 100%; }
.share-url input { border-radius: 10px 0 0 10px; font-size: 10px; }
.share-url button { border: 0; border-radius: 0 10px 10px 0; padding: 0 13px; background: var(--nav); color: #fff; font-size: 11px; cursor: pointer; }
.share-buttons { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-buttons a { border: 1px solid #dde1df; border-radius: 10px; padding: 10px; font-size: 11px; font-weight: 700; }

.revision { display: inline-flex; border: 1px solid #dfe2e1; border-radius: 6px; padding: 2px 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.row-actions { display: flex; gap: 5px; }
.row-actions a, .row-actions button { border: 1px solid #dfe2e1; border-radius: 7px; padding: 6px 8px; background: #fff; color: #59636a; font-size: 9px; font-weight: 700; cursor: pointer; }
.row-actions a:hover, .row-actions button:hover { color: var(--primary); border-color: #e8b6b2; }
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; }
.pagination a { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #dfe2e1; border-radius: 8px; background: #fff; font-size: 11px; }
.pagination a.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.credit-hero { display: flex; justify-content: space-between; align-items: center; overflow: hidden; border-radius: 20px; margin-bottom: 20px; padding: 31px 36px; background: var(--nav); color: #fff; }
.credit-hero small { color: #99a4a8; font-size: 9px; letter-spacing: 1px; }
.credit-hero strong { display: block; font-size: 42px; line-height: 1.2; }
.credit-hero strong span { font-size: 16px; color: #c6ced0; }
.credit-hero p { margin: 4px 0 0; color: #9fa9ac; font-size: 11px; }
.credit-rule { position: relative; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px 20px 27px; }
.credit-rule > span { font-family: "Manrope"; font-size: 21px; font-weight: 800; }
.credit-rule i { width: 25px; height: 1px; background: #59666c; }
.credit-rule small { position: absolute; right: 0; bottom: 7px; left: 0; color: #8d9a9f; text-align: center; font-size: 8px; }
.packages-card { margin-bottom: 20px; }
.secure-payment { color: var(--green); font-size: 10px; font-weight: 800; }
.config-warning { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #efd9b2; border-radius: 11px; margin-bottom: 15px; padding: 12px; background: #fffaf1; }
.config-warning > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; color: #fff; background: var(--amber); font-weight: 800; }
.config-warning strong, .config-warning p { display: block; margin: 0; }
.config-warning p { color: #786a56; font-size: 11px; }
.package-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.package-card { position: relative; display: flex; flex-direction: column; align-items: center; border: 1px solid #e0e3e1; border-radius: 15px; padding: 23px 15px 16px; text-align: center; }
.package-card.popular { border: 2px solid var(--primary); padding: 22px 14px 15px; }
.package-card > em { position: absolute; top: -10px; border-radius: 99px; padding: 4px 10px; background: var(--primary); color: #fff; font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: .6px; }
.package-mark { color: var(--primary); font-size: 22px; }
.package-card > strong { font-size: 28px; line-height: 1.1; }
.package-card > small { color: var(--muted); }
.package-card > div { margin: 10px 0 13px; font-weight: 800; }
.package-card .btn { width: 100%; min-height: 39px; }
.checkout-card { min-height: 600px; padding: 10px; }
#paytriframe { width: 100%; min-height: 580px; }
.result-card { max-width: 520px; margin: 10vh auto; border: 1px solid #e1e4e2; border-radius: 22px; padding: 45px; background: #fff; text-align: center; box-shadow: var(--shadow); }
.result-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 20px; font-weight: 800; font-size: 26px; }
.result-icon.success { color: var(--green); background: var(--green-soft); }
.result-icon.failed { color: var(--primary); background: var(--primary-soft); }
.result-card h1 { margin-bottom: 8px; font-size: 29px; }
.result-card p { color: var(--muted); font-size: 13px; }

.support-layout { display: grid; grid-template-columns: 380px 1fr; gap: 17px; }
.ticket-list { padding: 14px; }
.ticket-list .section-title { padding: 7px 7px 12px; margin: 0; }
.ticket-item { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 10px; border-radius: 11px; padding: 12px 10px; }
.ticket-item:hover, .ticket-item.active { background: #f5f6f5; }
.ticket-item.active { box-shadow: inset 3px 0 var(--primary); }
.ticket-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3a6; }
.ticket-dot.open { background: var(--primary); }
.ticket-dot.answered { background: var(--green); }
.ticket-item div { min-width: 0; }
.ticket-item strong, .ticket-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-item strong { font-size: 12px; }
.ticket-item small { color: var(--muted); font-size: 9px; }
.ticket-item em { color: var(--muted); font-size: 8px; font-style: normal; }
.conversation { min-height: 520px; display: flex; flex-direction: column; }
.messages { display: flex; flex: 1; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.message { max-width: 80%; border-radius: 13px; padding: 12px 14px; background: #f3f5f4; }
.message.user { align-self: flex-end; background: #fff0ed; }
.message div { display: flex; gap: 10px; justify-content: space-between; }
.message strong { font-size: 10px; }
.message time { color: var(--muted); font-size: 8px; }
.message p { margin: 5px 0 0; font-size: 12px; }
.reply-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; border-top: 1px solid var(--line); padding-top: 15px; }
.reply-form textarea { min-height: 68px; }

.admin-page-head { align-items: center; }
.admin-mode-badge, .record-count, .connection-state { display: inline-flex; align-items: center; border-radius: 99px; padding: 7px 11px; font-size: 9px; font-weight: 800; letter-spacing: .35px; }
.admin-mode-badge { color: var(--green); background: var(--green-soft); }
.admin-tabs { display: flex; gap: 7px; overflow-x: auto; margin: -8px 0 22px; padding: 4px 2px 8px; scrollbar-width: thin; }
.admin-tabs a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid #dde0df; border-radius: 10px; padding: 10px 14px; background: #fff; color: #59636a; font-size: 11px; font-weight: 700; }
.admin-tabs a:hover { border-color: #e6b3af; color: var(--primary); }
.admin-tabs a.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(215,53,43,.18); }
.admin-tabs a span { font-size: 15px; }
.admin-stat-grid strong { font-size: 18px; }
.admin-alert { display: flex; align-items: center; gap: 13px; border: 1px solid #ead9b8; border-radius: 14px; margin-bottom: 20px; padding: 15px 17px; background: #fffaf1; }
.admin-alert > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--amber); color: #fff; font-weight: 900; }
.admin-alert > div { flex: 1; }
.admin-alert strong, .admin-alert p { display: block; margin: 0; }
.admin-alert p { color: #796b55; font-size: 11px; }
.admin-alert .btn { min-height: 39px; padding: 8px 13px; font-size: 10px; }
.admin-alert.success { border-color: #cce6da; background: var(--green-soft); }
.admin-alert.success > span { background: var(--green); }
.admin-alert.success p { color: #517064; }
.admin-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.record-count { color: var(--muted); background: #f1f3f2; }
.status.active, .status.paid, .status.answered { color: var(--green); background: var(--green-soft); }
.status.suspended, .status.failed, .status.closed { color: var(--primary); background: var(--primary-soft); }
.status.pending, .status.open { color: var(--amber); background: var(--amber-soft); }
.status.verified-email { color: var(--green); background: var(--green-soft); }
.status.unverified-email { color: var(--amber); background: var(--amber-soft); }
.admin-users-table td { vertical-align: top; }
.admin-row-actions { position: relative; min-width: 82px; }
.admin-row-actions > summary { display: inline-flex; border: 1px solid #dadddc; border-radius: 8px; padding: 6px 10px; background: #fff; color: var(--primary); font-size: 10px; font-weight: 800; cursor: pointer; list-style: none; }
.admin-row-actions > summary::-webkit-details-marker { display: none; }
.admin-row-popover { width: 330px; display: grid; gap: 13px; margin-top: 9px; border: 1px solid #dfe2e1; border-radius: 12px; padding: 13px; background: #f8f9f8; box-shadow: 0 15px 35px rgba(24,33,38,.11); white-space: normal; }
.mini-admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-admin-form label { font-size: 10px; }
.mini-admin-form input, .mini-admin-form select { padding: 8px 9px; font-size: 10px; }
.mini-admin-form .btn { grid-column: 1 / -1; min-height: 34px; padding: 7px 10px; font-size: 9px; }
.credit-adjust-form { border-top: 1px solid #dfe2e1; padding-top: 12px; }
.verify-user-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #dfe2e1; padding-bottom: 12px; }
.verify-user-form > div { min-width: 0; }
.verify-user-form strong, .verify-user-form small { display: block; }
.verify-user-form strong { font-size: 10px; }
.verify-user-form small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.verify-user-form .btn { min-width: 104px; }
.admin-section-card, .settings-section { margin-bottom: 17px; }
.btn-credit-apply { min-height: 30px; border: 1px solid #b8dece; border-radius: 8px; padding: 5px 9px; background: var(--green-soft); color: var(--green); font-size: 9px; box-shadow: none; }
.btn-credit-apply:hover { background: #dff2e9; }
.text-muted { color: var(--muted); font-size: 9px; }
.ticket-status-form { display: flex; align-items: flex-end; gap: 9px; border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 14px; }
.ticket-status-form label { width: min(230px, 100%); }
.ticket-status-form select { padding-top: 9px; padding-bottom: 9px; }
.ticket-status-form .btn { min-height: 41px; }
.admin-settings-form { max-width: 1040px; }
.settings-section .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-section .span-2 { grid-column: 1 / -1; }
.connection-state.ready { color: var(--green); background: var(--green-soft); }
.connection-state.missing { color: var(--amber); background: var(--amber-soft); }
.toggle-label { display: flex; align-items: center; gap: 11px; border: 1px solid #dfe2e1; border-radius: 11px; margin-top: 7px; padding: 10px 12px; cursor: pointer; }
.toggle-label input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--primary); }
.toggle-label strong, .toggle-label small { display: block; }
.toggle-label small { margin: 1px 0 0; }
.admin-settings-actions { position: sticky; z-index: 12; bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #dfe2e1; border-radius: 15px; padding: 13px 15px; background: rgba(255,255,255,.94); box-shadow: 0 14px 40px rgba(23,32,39,.12); backdrop-filter: blur(12px); }
.admin-settings-actions .security-note { flex: 1; }
.admin-settings-actions .btn { min-width: 190px; }
.admin-sidebar-menu > summary.active { color: var(--menu-active-text); background: var(--menu-active-bg); }
.appearance-settings-form { max-width: 1120px; }
.brand-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.brand-upload-card { display: grid; grid-template-columns: minmax(150px, .8fr) 1fr; align-items: center; gap: 15px 18px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fafbfa; }
.brand-upload-card > div:nth-child(2) strong, .brand-upload-card > div:nth-child(2) small { display: block; }
.brand-upload-card > div:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.brand-upload-stage { grid-row: span 2; min-height: 112px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; padding: 15px; font-size: 10px; font-weight: 700; }
.brand-upload-card.light .brand-upload-stage { border: 1px solid #e1e4e3; background: #fff; color: #879096; }
.brand-upload-card.dark .brand-upload-stage { border: 1px solid #364148; background: #182126; color: #aab4b8; }
.brand-upload-stage img { display: block; width: 100%; height: 80px; object-fit: contain; }
.brand-file-button { display: inline-flex; width: max-content; min-height: 38px; align-items: center; justify-content: center; border: 1px solid #d8dcdd; border-radius: 10px; padding: 8px 13px; background: #fff; color: var(--ink); cursor: pointer; }
.brand-file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.remove-brand-logo { grid-column: 2; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 500; }
.remove-brand-logo input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.appearance-color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.appearance-color-field { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fafbfa; }
.appearance-color-field > span:first-child, .appearance-color-field > small { display: block; }
.appearance-color-field > small { min-height: 34px; margin-top: 2px; }
.appearance-color-control { display: flex; align-items: center; gap: 9px; margin-top: 11px; }
.appearance-color-control input[type="color"] { width: 48px; height: 42px; flex: 0 0 48px; border: 0; border-radius: 10px; margin: 0; padding: 0; overflow: hidden; background: transparent; cursor: pointer; }
.appearance-color-control b { color: var(--ink); font-size: 11px; letter-spacing: .25px; }

.guest-shell { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(410px, .95fr) minmax(500px, 1.25fr); }
.auth-story { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px 55px; background: var(--nav); color: #fff; }
.auth-story::before { content: ""; position: absolute; right: -180px; bottom: -170px; width: 550px; height: 550px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.auth-story::after { content: "X"; position: absolute; right: 42px; bottom: 12px; color: rgba(215,53,43,.28); font-size: 220px; font-weight: 900; letter-spacing: -20px; transform: rotate(-8deg) skew(-7deg); }
.brand-light { position: relative; z-index: 1; color: #fff; }
.auth-story > div { position: relative; z-index: 1; max-width: 560px; }
.story-label { color: #e47770; font-size: 9px; letter-spacing: 1.8px; font-weight: 800; }
.auth-story h1 { margin: 13px 0 13px; font-size: clamp(39px, 5vw, 64px); line-height: 1.03; }
.auth-story p { max-width: 470px; color: #9eaaae; font-size: 14px; }
.story-stats { display: flex; gap: 42px; }
.story-stats strong, .story-stats span { display: block; }
.story-stats strong { font-size: 16px; }
.story-stats span { color: #8f9b9f; font-size: 9px; }
.auth-panel { display: grid; place-items: center; padding: 45px; }
.auth-card { width: min(510px, 100%); border: 1px solid #e1e3e1; border-radius: 22px; padding: 38px; background: #fff; box-shadow: 0 20px 60px rgba(23,32,39,.08); }
.auth-card > h2 { margin: 6px 0 4px; font-size: 27px; }
.auth-card > p { color: var(--muted); font-size: 12px; }
.auth-card .stack-form { margin-top: 23px; }
.password-wrap { position: relative; margin-top: 7px; }
.password-wrap input { margin: 0; padding-right: 65px; }
.password-wrap button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: none; color: var(--primary); font-size: 10px; font-weight: 700; cursor: pointer; }
.auth-switch { margin: 19px 0 !important; text-align: center; }
.auth-switch a { color: var(--primary); font-weight: 800; }
.auth-card > .security-note { justify-content: center; }
.mobile-auth-brand { display: none; }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stepper li div { display: none; }
    .stepper li:not(:last-child)::after { left: 35px; }
    .package-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-layout { grid-template-columns: .85fr 1.15fr; }
    .auth-story { padding: 38px; }
    .admin-overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
    html { background: #eef0f2; overscroll-behavior-y: none; }
    body { background: #eef0f2; overscroll-behavior-y: none; }
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 12px 0 45px rgba(12,18,21,.25); }
    body.menu-open .sidebar { transform: none; }
    .sidebar-scrim { position: fixed; z-index: 29; inset: 0; background: rgba(8,13,15,.45); }
    body.menu-open .sidebar-scrim { display: block; }
    .main-area { margin-left: 0; background: #eef0f2; }
    .topbar { justify-content: space-between; height: 64px; padding: 0 16px; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(215,220,223,.75); box-shadow: 0 5px 22px rgba(22,31,37,.055); backdrop-filter: blur(18px) saturate(150%); }
    .menu-toggle { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #e1e4e6; border-radius: 12px; background: #f7f8f8; font-size: 19px; cursor: pointer; }
    .mobile-brand { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 850; }
    .mobile-brand .brand-mark { width: 29px; height: 29px; flex-basis: 29px; border-radius: 9px 3px 9px 3px; font-size: 15px; }
    .mobile-brand .brand-x { letter-spacing: -1px; }
    .top-actions { gap: 8px; }
    .top-actions .user-avatar { width: 38px; height: 38px; border: 2px solid #fff; box-shadow: 0 3px 12px rgba(22,31,37,.1); }
    .page-content { padding: 24px 18px calc(98px + env(safe-area-inset-bottom)); }
    .content-card, .info-card { border-color: rgba(220,224,226,.65); box-shadow: 0 8px 28px rgba(22,31,37,.055); }
    .bottom-nav { position: fixed; z-index: 25; right: 8px; bottom: 0; left: 8px; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(74px + env(safe-area-inset-bottom)); padding: 8px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: rgba(255,255,255,.97); border: 1px solid rgba(219,223,225,.86); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -9px 34px rgba(19,28,34,.1); backdrop-filter: blur(18px) saturate(155%); }
    .bottom-nav a { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 13px; color: #899297; }
    .bottom-nav a > span { display: grid; width: 31px; height: 29px; place-items: center; border-radius: 10px; font-size: 19px; transition: background .18s, transform .18s; }
    .bottom-nav small { max-width: 100%; overflow: hidden; font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
    .bottom-nav a.active { color: var(--primary); }
    .bottom-nav a.active > span { background: var(--primary-soft); transform: translateY(-1px); }
    .bottom-nav .create-action span { display: grid; place-items: center; width: 53px; height: 53px; margin-top: -29px; border: 6px solid #eef0f2; border-radius: 18px; background: linear-gradient(145deg, #e54439, #c92820); color: #fff; font-size: 27px; box-shadow: 0 10px 24px rgba(215,53,43,.3); transform: rotate(-2deg); }
    .settings-grid, .support-layout { grid-template-columns: 1fr; }
    .info-card, .bank-card { position: static; }
    .support-layout .ticket-list { max-height: 360px; overflow-y: auto; }
    .hero-art { opacity: .4; right: -30px; }
    .guest-shell { min-height: 100svh; background: var(--nav); }
    .auth-layout { display: flex; width: 100%; min-width: 0; min-height: 100svh; flex-direction: column; background: var(--nav); }
    .auth-story { display: flex; min-height: 302px; justify-content: flex-start; padding: calc(24px + env(safe-area-inset-top)) 24px 66px; }
    .auth-story::before { right: -165px; bottom: -245px; width: 430px; height: 430px; }
    .auth-story::after { right: 22px; bottom: -35px; font-size: 150px; }
    .auth-story .brand { margin-bottom: 34px; }
    .auth-story > div { max-width: 520px; }
    .auth-story h1 { max-width: 500px; margin: 10px 0 9px; font-size: clamp(32px, 9.4vw, 44px); }
    .auth-story p { max-width: 440px; margin: 0; font-size: 12px; line-height: 1.5; }
    .story-stats { display: none; }
    .auth-panel { position: relative; z-index: 2; display: block; width: 100%; min-width: 0; min-height: 0; flex: 1; margin-top: -38px; border-radius: 32px 32px 0 0; padding: 12px 14px calc(26px + env(safe-area-inset-bottom)); background: #f4f5f6; box-shadow: 0 -16px 45px rgba(4,9,11,.16); }
    .auth-card { width: 100%; min-width: 0; max-width: 560px; border: 0; border-radius: 25px; margin: 0 auto; padding: 28px 23px; box-shadow: 0 10px 32px rgba(23,32,39,.075); }
    .auth-switch { overflow-wrap: anywhere; }
    .mobile-auth-brand { display: none; }
}

@media (max-width: 620px) {
    body { font-size: 14px; }
    .top-actions .balance-chip { display: none; }
    .page-content { padding: 20px 13px 88px; }
    .page-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
    .page-head h1 { font-size: 28px; }
    .page-head p { font-size: 12px; }
    .page-head > .btn { width: 100%; min-width: 45px; padding: 10px 13px; }
    .admin-page-head { display: block; }
    .admin-mode-badge { margin-top: 12px; }
    .admin-tabs { margin-bottom: 15px; }
    .admin-tabs a { padding: 9px 11px; }
    .admin-stat-grid { grid-template-columns: 1fr 1fr; }
    .admin-alert { align-items: flex-start; flex-wrap: wrap; }
    .admin-alert .btn { width: 100%; }
    .settings-section .form-grid { grid-template-columns: 1fr; }
    .settings-section .span-2 { grid-column: auto; }
    .admin-settings-actions { align-items: stretch; flex-direction: column; bottom: 78px; }
    .admin-settings-actions .btn { width: 100%; }
    .admin-row-popover { width: min(300px, calc(100vw - 70px)); }
    .dashboard-head { display: block; }
    .dashboard-head .btn { width: 100%; margin-top: 15px; }
    .hero-card { min-height: 250px; padding: 28px 23px; align-items: flex-start; }
    .hero-card h2 { max-width: 87%; font-size: 26px; }
    .hero-card p { max-width: 86%; font-size: 11px; }
    .hero-art { top: 65px; right: -76px; transform: scale(.78); opacity: .32; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-grid article { display: grid; grid-template-columns: 34px 1fr; gap: 9px; padding: 13px; }
    .stat-grid em, .stat-grid a { display: none; }
    .stat-icon { width: 34px; height: 34px; flex-basis: 34px; }
    .stat-grid strong { font-size: 19px; }
    .content-card, .info-card { padding: 17px; border-radius: 15px; }
    .field-row, .field-row.three, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .company-form { display: block; }
    .company-form > * + * { margin-top: 14px; }
    .builder-head { align-items: flex-start; }
    .builder-head h1 { font-size: 25px; }
    .builder-head p { max-width: 260px; }
    .builder-credit { padding: 7px 9px; }
    .builder-credit small { display: none; }
    .stepper { margin: 0 5px 13px; }
    .stepper li { gap: 0; }
    .stepper li > span { width: 28px; height: 28px; flex-basis: 28px; font-size: 10px; }
    .stepper li:not(:last-child)::after { top: 14px; left: 28px; right: 0; }
    .builder-card { min-height: calc(100vh - 218px); margin: 0 -13px; border-radius: 17px 17px 0 0; border-right: 0; border-left: 0; }
    .wizard-panel { padding: 25px 18px 22px; }
    .panel-heading { margin-bottom: 21px; }
    .panel-heading h2 { font-size: 21px; }
    .number-field { grid-template-columns: 1fr; }
    .number-field .btn { width: 100%; }
    .quote-item { grid-template-columns: 32px 1fr 32px 32px; gap: 8px; padding: 10px; }
    .quote-item-meta { display: none; }
    .quote-item button { width: 29px; height: 29px; }
    .choice-grid { grid-template-columns: 1fr; }
    .choice-card { min-height: 115px; }
    .theme-grid { grid-template-columns: 1fr; }
    .theme-card { grid-template-columns: 96px 1fr; }
    .theme-mini { width: 96px; }
    .color-editor { grid-template-columns: 1fr 1fr; }
    .color-editor > div { grid-column: span 2; }
    .color-editor .btn { grid-column: span 2; }
    .currency-warning > div { display: block; }
    .currency-warning label { margin-top: 9px; }
    .preview-panel { padding-right: 12px; padding-left: 12px; }
    .paper-wrap { padding: 12px; }
    .quote-paper { width: 690px; min-height: 930px; padding: 48px; transform-origin: top left; }
    .quote-paper[class*="preview-theme-"] { padding: 42px 38px 64px; }
    .quote-paper.preview-theme-hiza, .quote-paper.preview-theme-minimal { padding: 0; }
    .paper-wrap { height: 600px; }
    .preview-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .preview-actions .btn-primary { grid-column: span 2; }
    .wizard-actions { position: sticky; bottom: 62px; z-index: 5; margin-right: -18px; margin-left: -18px; padding: 13px 18px; background: rgba(255,255,255,.96); box-shadow: 0 -8px 22px rgba(21,29,34,.05); }
    .preview-back { position: static; margin: 14px 0 0; padding: 0; box-shadow: none; background: transparent; }
    .dialog-card { padding: 21px 17px; }
    .app-dialog { margin-bottom: max(12px, env(safe-area-inset-bottom)); }
    .package-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .package-card { padding: 18px 9px 12px; }
    .credit-hero { padding: 25px 22px; }
    .credit-hero strong { font-size: 34px; }
    .credit-rule { display: none; }
    .row-actions { min-width: 180px; }
    .conversation { min-height: 430px; }
    .message { max-width: 92%; }
    .reply-form { grid-template-columns: 1fr; }
    .auth-story { min-height: 275px; padding-right: 19px; padding-left: 19px; }
    .auth-story .brand { margin-bottom: 25px; }
    .auth-story h1 { font-size: 32px; }
    .auth-story p { display: none; }
    .auth-panel { margin-top: -30px; padding: 10px 10px calc(20px + env(safe-area-inset-bottom)); }
    .auth-card { border-radius: 23px; padding: 25px 18px; }
    .auth-card .field-row { gap: 17px; }
    .guest-shell .toast { top: 10px; }
}

/* Mobil uygulama kabuğu */
@media (max-width: 840px) {
    :root { --mobile-top: calc(68px + env(safe-area-inset-top)); --mobile-bottom: calc(72px + env(safe-area-inset-bottom)); }
    html, body { min-height: 100dvh; background: #f3f5f7; }
    body { color: #111820; }
    .app-shell { min-height: 100dvh; }
    .main-area { min-height: 100dvh; padding-top: var(--mobile-top); background: linear-gradient(180deg, #f8fafb 0, #f3f5f7 210px); }
    .topbar { position: fixed; inset: 0 0 auto; height: var(--mobile-top); padding: env(safe-area-inset-top) 17px 0; background: rgba(250,251,252,.94); border: 0; border-bottom: 1px solid rgba(204,211,216,.7); box-shadow: 0 6px 24px rgba(19,29,37,.055); backdrop-filter: blur(22px) saturate(180%); }
    .menu-toggle { width: 42px; height: 42px; border: 0; border-radius: 14px; background: #eef1f3; color: #273139; font-size: 0; }
    .menu-toggle::before { content: ""; width: 18px; height: 12px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; box-shadow: inset 0 4px transparent, inset 0 6px currentColor, inset 0 8px transparent; }
    .mobile-brand { gap: 8px; font-size: 16px; letter-spacing: -.5px; }
    .mobile-brand .brand-mark { width: 31px; height: 31px; flex-basis: 31px; border-radius: 10px; transform: none; box-shadow: 0 6px 15px rgba(215,53,43,.24); }
    .top-actions .user-avatar { width: 40px; height: 40px; background: #192329; color: #fff; border: 0; box-shadow: 0 5px 16px rgba(20,30,36,.16); }
    .page-content { max-width: 760px; min-height: calc(100dvh - var(--mobile-top)); padding: 22px 16px calc(var(--mobile-bottom) + 24px); }
    .bottom-nav { right: 0; left: 0; height: var(--mobile-bottom); padding: 7px max(10px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left)); border: 0; border-top: 1px solid rgba(205,211,215,.78); border-radius: 0; background: rgba(251,252,253,.96); box-shadow: 0 -8px 26px rgba(18,27,34,.07); backdrop-filter: blur(24px) saturate(180%); }
    .bottom-nav a { min-height: 55px; border-radius: 15px; }
    .bottom-nav a > span { width: 34px; height: 30px; font-size: 20px; }
    .bottom-nav small { font-size: 9px; font-weight: 750; letter-spacing: -.1px; }
    .bottom-nav a.active > span { background: transparent; transform: none; }
    .bottom-nav a.active::after { position: absolute; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); content: ""; }
    .bottom-nav .create-action span { width: 54px; height: 54px; margin-top: -27px; border: 5px solid #f3f5f7; border-radius: 18px; transform: none; box-shadow: 0 10px 25px rgba(215,53,43,.3); }
    .sidebar { width: min(330px, 87vw); padding-top: calc(24px + env(safe-area-inset-top)); border-radius: 0 28px 28px 0; background: var(--sidebar-bg); }
    .sidebar-scrim { background: rgba(6,11,14,.52); backdrop-filter: blur(3px); }
    .sidebar nav > a, .sidebar summary { min-height: 50px; border-radius: 14px; font-size: 14px; }
    .sidebar nav > a.active, .sidebar details a.active { box-shadow: 0 8px 22px color-mix(in srgb, var(--menu-active-bg) 28%, transparent); }
    .page-head { margin-top: 2px; }
    .page-head h1 { font-size: clamp(28px, 7.8vw, 36px); }
    .content-card, .info-card, .builder-card { border: 0; border-radius: 22px; box-shadow: 0 10px 30px rgba(25,36,44,.065); }
    input, textarea, select { min-height: 50px; border-color: #dce1e4; border-radius: 14px; background-color: #fafbfc; font-size: 16px; }
    textarea { min-height: 104px; }
    .btn { min-height: 50px; border-radius: 14px; }
    .btn:active, .bottom-nav a:active, .choice-card:active, .quote-item:active { transform: scale(.985); }
    .app-dialog { width: min(620px, calc(100% - 16px)); max-height: calc(100dvh - 12px); margin: auto auto max(8px, env(safe-area-inset-bottom)); }
    .dialog-card { max-height: calc(100dvh - 12px); border-radius: 26px; padding: 24px 20px calc(22px + env(safe-area-inset-bottom)); }
    .dialog-card.compact { border-radius: 26px; }
    .toast { top: calc(10px + env(safe-area-inset-top)); border-radius: 16px; }
    .top-actions .theme-toggle { width: 40px; min-width: 40px; height: 40px; padding: 0; }
    .top-actions .theme-toggle small { display: none; }
    .brand-upload-grid { grid-template-columns: 1fr; }
    .appearance-color-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .page-content { padding-right: 12px; padding-left: 12px; }
    .page-head > div { min-width: 0; }
    .dashboard-head .btn { min-height: 54px; border-radius: 17px; font-size: 14px; }
    .hero-card { min-height: 212px; border-radius: 25px; margin-bottom: 14px; padding: 25px 22px; background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.16), transparent 31%), linear-gradient(145deg, #e03e34, #b8241c 72%); box-shadow: 0 18px 36px rgba(183,39,31,.2); }
    .hero-card h2 { margin-top: 7px; font-size: 27px; }
    .hero-card .btn { min-height: 46px; border-radius: 14px; }
    .stat-grid { gap: 10px; margin-bottom: 14px; }
    .stat-grid article { min-height: 94px; display: flex; align-items: flex-start; flex-direction: column; gap: 8px; border: 0; border-radius: 19px; padding: 15px; box-shadow: 0 8px 24px rgba(24,35,42,.055); }
    .stat-grid article > div { display: flex; width: 100%; align-items: flex-end; justify-content: space-between; gap: 8px; }
    .stat-grid small { font-size: 10px; }
    .stat-grid strong { font-size: 24px; }
    .stat-icon { width: 37px; height: 37px; border-radius: 12px; }
    .dashboard-head ~ .content-card .table-scroll { overflow: visible; }
    .dashboard-head ~ .content-card .data-table, .dashboard-head ~ .content-card .data-table tbody { display: block; }
    .dashboard-head ~ .content-card .data-table thead { display: none; }
    .dashboard-head ~ .content-card .data-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; border-bottom: 1px solid #e8ebed; padding: 14px 0; }
    .dashboard-head ~ .content-card .data-table tr:last-child { border: 0; }
    .dashboard-head ~ .content-card .data-table td { display: block; border: 0; padding: 0; font-size: 11px; }
    .dashboard-head ~ .content-card .data-table td:first-child { grid-column: 1; }
    .dashboard-head ~ .content-card .data-table td:nth-child(2) { grid-column: 1; color: var(--muted); }
    .dashboard-head ~ .content-card .data-table td:nth-child(3), .dashboard-head ~ .content-card .data-table td:nth-child(4) { color: var(--muted); font-size: 9px; }
    .dashboard-head ~ .content-card .data-table td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
    .dashboard-head ~ .content-card .data-table td:last-child { display: none; }
    .builder-head { padding: 0 3px; }
    .builder-head h1 { font-size: 27px; }
    .builder-head p { display: none; }
    .builder-credit { border: 0; border-radius: 14px; background: #192329; color: #fff; }
    .stepper { height: 36px; align-items: center; margin-bottom: 12px; padding: 0 8px; }
    .stepper li > span { width: 30px; height: 30px; flex-basis: 30px; background: #fff; }
    .builder-card { min-height: calc(100dvh - 184px); margin: 0 -12px; border-radius: 25px 25px 0 0; }
    .wizard-panel { padding: 27px 18px calc(24px + env(safe-area-inset-bottom)); }
    .panel-heading { margin-bottom: 23px; padding-bottom: 18px; }
    .panel-heading h2 { font-size: 23px; }
    .quote-item { border: 0; border-radius: 17px; background: #f6f8f9; box-shadow: inset 0 0 0 1px #e4e8ea; }
    .choice-card, .theme-card, .color-editor { border-radius: 18px; }
    .choice-card { min-height: 104px; }
    .theme-card { padding: 14px; }
    .color-editor { grid-template-columns: 1fr 1fr; padding: 16px; }
    .wizard-actions { bottom: calc(var(--mobile-bottom) - 1px); margin: 28px -18px -24px; padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(216,221,224,.8); background: rgba(255,255,255,.97); backdrop-filter: blur(20px); }
    .wizard-actions .btn { min-height: 48px; }
    .auth-story { min-height: 38svh; padding: calc(25px + env(safe-area-inset-top)) 22px 74px; }
    .auth-story h1 { max-width: 330px; font-size: 34px; line-height: 1.08; }
    .auth-panel { min-height: 62svh; margin-top: -44px; border-radius: 34px 34px 0 0; padding: 10px 10px calc(22px + env(safe-area-inset-bottom)); }
    .auth-card { border-radius: 27px; padding: 27px 20px; box-shadow: none; }
    .auth-card h2 { font-size: 26px; }
    .auth-card .btn-primary { min-height: 54px; font-size: 15px; }
    .appearance-color-grid { grid-template-columns: 1fr; }
    .brand-upload-card { grid-template-columns: 1fr; }
    .brand-upload-stage { grid-row: auto; }
    .remove-brand-logo { grid-column: auto; }
    .brand-file-button { width: 100%; }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: var(--configured-dark-bg);
    --surface: color-mix(in srgb, var(--configured-dark-bg) 82%, #ffffff);
    --ink: #edf2f3;
    --muted: #9ba7ac;
    --line: rgba(226,235,238,.13);
    --primary-soft: color-mix(in srgb, var(--primary) 20%, var(--configured-dark-bg));
    --green-soft: rgba(22,123,85,.19);
    --amber-soft: rgba(168,100,8,.2);
    --blue-soft: rgba(36,101,168,.22);
    --shadow: 0 16px 44px rgba(0,0,0,.25);
    --sidebar-bg: var(--sidebar-bg-dark);
    --sidebar-text: var(--menu-text-dark);
    --sidebar-hover: var(--menu-hover-dark);
    --sidebar-hover-text: var(--menu-hover-text-dark);
}
html[data-theme="dark"], html[data-theme="dark"] body, html[data-theme="dark"] .main-area { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .topbar { border-color: rgba(255,255,255,.08); background: color-mix(in srgb, var(--configured-dark-bg) 88%, transparent); }
html[data-theme="dark"] .bottom-nav { border-color: rgba(255,255,255,.1); background: color-mix(in srgb, var(--configured-dark-bg) 94%, #ffffff); }
html[data-theme="dark"] .menu-toggle { border-color: var(--line); background: var(--surface); color: var(--ink); }
html[data-theme="dark"] label { color: #d9e0e2; }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { border-color: rgba(255,255,255,.15); background-color: color-mix(in srgb, var(--surface) 92%, #000000); color: var(--ink); }
html[data-theme="dark"] input:disabled { background: rgba(255,255,255,.06); color: #7f8b90; }
html[data-theme="dark"] .theme-toggle, html[data-theme="dark"] .balance-chip, html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .btn-ghost, html[data-theme="dark"] .brand-file-button { border-color: rgba(255,255,255,.14); background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .btn-secondary:hover, html[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .content-card, html[data-theme="dark"] .info-card, html[data-theme="dark"] .stat-grid article, html[data-theme="dark"] .builder-credit, html[data-theme="dark"] .builder-card, html[data-theme="dark"] .dialog-card, html[data-theme="dark"] .result-card, html[data-theme="dark"] .auth-card { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); }
html[data-theme="dark"] .quote-item, html[data-theme="dark"] .choice-card, html[data-theme="dark"] .theme-card, html[data-theme="dark"] .color-editor, html[data-theme="dark"] .package-card, html[data-theme="dark"] .ticket-item:hover, html[data-theme="dark"] .ticket-item.active, html[data-theme="dark"] .message, html[data-theme="dark"] .admin-row-popover, html[data-theme="dark"] .brand-upload-card, html[data-theme="dark"] .appearance-color-field { border-color: var(--line); background: rgba(255,255,255,.035); }
html[data-theme="dark"] .quote-item button, html[data-theme="dark"] .row-actions a, html[data-theme="dark"] .row-actions button, html[data-theme="dark"] .pagination a, html[data-theme="dark"] .admin-tabs a, html[data-theme="dark"] .admin-row-actions > summary { border-color: var(--line); background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .data-table th, html[data-theme="dark"] .data-table td, html[data-theme="dark"] .credit-adjust-form, html[data-theme="dark"] .ticket-status-form { border-color: var(--line); }
html[data-theme="dark"] .record-count, html[data-theme="dark"] .icon-link { background: rgba(255,255,255,.07); }
html[data-theme="dark"] .security-note { background: rgba(22,123,85,.16); color: #a8d4c3; }
html[data-theme="dark"] .admin-settings-actions { border-color: var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); }
html[data-theme="dark"] .auth-panel { background: var(--bg); }
html[data-theme="dark"] .brand-upload-card.light .brand-upload-stage { background: #fff; color: #69747a; }
html[data-theme="dark"] .brand-upload-card.dark .brand-upload-stage { background: #11191e; }
html[data-theme="dark"] .quote-paper, html[data-theme="dark"] .quote-paper input, html[data-theme="dark"] .quote-paper textarea, html[data-theme="dark"] .quote-paper select { color-scheme: light; background-color: #fff; color: #172027; }
html[data-theme="dark"] .paper-wrap { background: color-mix(in srgb, var(--configured-dark-bg) 70%, #000000); }
html[data-theme="dark"] .wizard-actions { border-color: var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); }

@media (max-width: 840px) {
    html[data-theme="dark"], html[data-theme="dark"] body { background: var(--bg); }
    html[data-theme="dark"] .main-area { background: linear-gradient(180deg, color-mix(in srgb, var(--configured-dark-bg) 90%, #ffffff) 0, var(--configured-dark-bg) 220px); }
    html[data-theme="dark"] .bottom-nav .create-action span { border-color: var(--configured-dark-bg); }
    html[data-theme="dark"] .content-card, html[data-theme="dark"] .info-card, html[data-theme="dark"] .builder-card { border: 1px solid var(--line); }
}

@media (display-mode: standalone) {
    .topbar { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
    .bottom-nav { height: calc(74px + env(safe-area-inset-bottom)); }
}

@media print {
    .sidebar, .topbar, .bottom-nav, .builder-head, .stepper, .panel-heading, .preview-toolbar, .preview-actions, .wizard-actions, .currency-warning { display: none !important; }
    .main-area, .page-content { margin: 0; padding: 0; }
    .builder-card, .paper-wrap { border: 0; padding: 0; box-shadow: none; background: #fff; }
    .quote-paper { box-shadow: none; }
}
