*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:#f4f6f9;color:#1f2937}a{text-decoration:none;color:inherit}.login-page{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#1e3a8a,#0ea5e9)}.login-card{background:#fff;padding:40px;border-radius:12px;width:360px;box-shadow:0 10px 30px #0003}.login-card h1{margin:0 0 4px;font-size:22px}.subtitle{color:#6b7280;margin-bottom:20px;font-size:14px}.login-card label{display:block;margin:12px 0 4px;font-size:13px;font-weight:600}.login-card input{width:100%;padding:10px;border:1px solid #d1d5db;border-radius:6px}.login-card select{width:100%;padding:10px;border:1px solid #d1d5db;border-radius:6px;background:#fff}.login-card button{width:100%;margin-top:20px;padding:11px;background:#1e3a8a;color:#fff;border:none;border-radius:6px;font-weight:600;cursor:pointer}.login-card button:hover{background:#1e40af}.hint{font-size:12px;color:#9ca3af;margin-top:14px;text-align:center}.alert-error{background:#fee2e2;color:#b91c1c;padding:8px 12px;border-radius:6px;font-size:13px;margin-bottom:10px}.app-shell{display:flex;min-height:100vh}.sidebar{width:230px;background:#111827;color:#e5e7eb;display:flex;flex-direction:column;padding:20px 0}.sidebar nav{overflow-y:auto;flex:1}.sidebar-brand{font-size:20px;font-weight:700;padding:0 20px 20px;color:#fff}.nav-link{display:flex;align-items:center;gap:10px;padding:11px 20px;color:#cbd5e1;font-size:14px}.nav-group-label{padding:14px 20px 4px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#6b7280;font-weight:700}.nav-link:hover{background:#1f2937;color:#fff}.nav-link.active{background:#1e3a8a;color:#fff;font-weight:600}.sidebar-footer{margin-top:auto;padding:16px 20px;border-top:1px solid #1f2937}.user-name{font-weight:600;font-size:14px}.user-role{font-size:12px;color:#9ca3af;margin-bottom:10px}.btn-logout{width:100%;padding:8px;background:#374151;color:#fff;border:none;border-radius:6px;cursor:pointer}.btn-logout:hover{background:#4b5563}.app-content{flex:1;padding:28px;overflow-y:auto}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.topbar-search{flex:1;max-width:480px}.topbar-search input{width:100%;padding:9px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;background:#fff}.topbar-bell{position:relative;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:8px 12px;cursor:pointer;font-size:16px}.topbar-bell-count{position:absolute;top:-6px;right:-6px;background:#dc2626;color:#fff;font-size:10px;font-weight:700;border-radius:10px;padding:1px 5px}.page h1{margin-top:0;font-size:24px}.page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:10px}.page-header button{padding:9px 16px;background:#1e3a8a;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600}.page-header input{padding:9px 12px;border:1px solid #d1d5db;border-radius:6px;min-width:260px}.card-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}.stat-card{background:#fff;padding:18px;border-radius:10px;box-shadow:0 1px 3px #00000014}.stat-value{font-size:26px;font-weight:700;color:#1e3a8a}.stat-label{font-size:13px;color:#6b7280;margin-top:4px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}.panel{background:#fff;padding:20px;border-radius:10px;box-shadow:0 1px 3px #00000014}.panel h3{margin-top:0}.checklist-panel{margin-top:20px}.muted{color:#6b7280;font-size:13px}.simple-list{list-style:none;padding:0;margin:0}.simple-list li{padding:8px 0;border-bottom:1px solid #f0f0f0;font-size:14px}.simple-list li:last-child{border-bottom:none}.simple-list li.clickable{cursor:pointer}.simple-list li.clickable:hover{color:#1e3a8a}.table-wrap{background:#fff;border-radius:10px;overflow:hidden;box-shadow:0 1px 3px #00000014}.data-table{width:100%;border-collapse:collapse}.data-table th{text-align:left;padding:12px 16px;background:#f9fafb;font-size:12px;text-transform:uppercase;color:#6b7280;border-bottom:1px solid #e5e7eb}.data-table td{padding:12px 16px;border-bottom:1px solid #f3f4f6;font-size:14px}.data-table tr.clickable{cursor:pointer}.data-table tr.clickable:hover{background:#f9fafb}.empty-cell{text-align:center;color:#9ca3af;padding:30px!important}.badge{display:inline-block;padding:3px 10px;border-radius:20px;background:#e0e7ff;color:#3730a3;font-size:12px;font-weight:600}.badge-active{background:#dcfce7;color:#166534}.badge-pending{background:#fef9c3;color:#854d0e}.badge-suspended{background:#fee2e2;color:#991b1b}.inline-form{background:#fff;padding:18px;border-radius:10px;margin-bottom:18px;display:flex;flex-wrap:wrap;gap:10px;box-shadow:0 1px 3px #00000014}.inline-form input,.inline-form select,.inline-form textarea{padding:9px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;flex:1;min-width:160px}.inline-form textarea{width:100%;min-height:60px;flex-basis:100%}.inline-form .field-inline{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#6b7280;font-weight:600;flex:1;min-width:120px}.invoice-summary{background:#fff;padding:18px;border-radius:10px;box-shadow:0 1px 3px #00000014;margin-bottom:18px}.invoice-summary table{width:100%;border-collapse:collapse}.invoice-summary td{padding:6px 4px}.invoice-summary td:last-child{text-align:right}.invoice-summary .total-row td{font-weight:700;border-top:1px solid #e5e7eb;padding-top:10px}.row-actions{display:flex;gap:6px;flex-wrap:wrap}.inline-form button{padding:9px 18px;background:#1e3a8a;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600}.btn-small{padding:4px 10px;font-size:12px;border:none;border-radius:5px;background:#1e3a8a;color:#fff;cursor:pointer;margin-left:6px}.btn-small.btn-danger{background:#dc2626}select{padding:9px 12px;border:1px solid #d1d5db;border-radius:6px}.btn-secondary{padding:9px 16px;background:#fff;color:#1e3a8a;border:1px solid #1e3a8a;border-radius:6px;cursor:pointer;font-weight:600}.btn-secondary:hover{background:#eef2ff}.btn-secondary:disabled,.page-header button:disabled,.inline-form button:disabled{opacity:.6;cursor:not-allowed}.permission-matrix th,.permission-matrix td{text-align:center}.permission-matrix td:first-child,.permission-matrix th:first-child{text-align:left}.permission-matrix input[type=checkbox]{width:16px;height:16px;cursor:pointer}.stat-card{transition:transform .15s ease,box-shadow .15s ease}.stat-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px #0000001a}.chart-card h3{margin-top:0;margin-bottom:12px;font-size:15px}.portal-sidebar .sidebar-brand{display:flex;align-items:center;gap:8px}.portal-avatar{width:40px;height:40px;border-radius:50%;background:#1e3a8a;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;margin:0 auto 8px}.portal-sidebar .sidebar-footer{text-align:center}.portal-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:20px}.portal-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid #f0f0f0;gap:12px}.portal-row:last-child{border-bottom:none}.portal-card-list{display:flex;flex-direction:column;gap:10px}.portal-card{background:#fff;border-radius:10px;padding:14px 18px;box-shadow:0 1px 3px #00000014;display:flex;justify-content:space-between;align-items:center;gap:12px}.portal-card-main{display:flex;flex-direction:column;gap:2px}.portal-badge{display:inline-block;padding:4px 12px;border-radius:20px;font-size:12px;font-weight:700;background:#e0e7ff;color:#3730a3;white-space:nowrap}.portal-badge-green{background:#dcfce7;color:#15803d}.portal-badge-amber{background:#fef3c7;color:#b45309}.portal-badge-red{background:#fee2e2;color:#b91c1c}@media (max-width: 900px){.two-col,.portal-grid{grid-template-columns:1fr}.card-grid{grid-template-columns:repeat(2,1fr)}}.landing-page{min-height:100vh;background:#f9fafb;padding:48px 24px}.landing-hero{text-align:center;max-width:640px;margin:0 auto 40px}.landing-hero h1{font-size:32px;color:#1f3864;margin-bottom:8px}.landing-hero p{color:#4b5563;margin-bottom:4px}.plan-grid{display:flex;flex-wrap:wrap;gap:24px;justify-content:center;max-width:1080px;margin:0 auto;align-items:stretch}.plan-card{position:relative;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:28px 24px;width:300px;display:flex;flex-direction:column;box-shadow:0 1px 2px #0000000a}.plan-card.featured{border-color:#1f3864;box-shadow:0 8px 24px #1f386426;transform:translateY(-4px)}.plan-badge{position:absolute;top:-12px;left:50%;transform:translate(-50%);background:#1f3864;color:#fff;font-size:12px;font-weight:600;padding:4px 12px;border-radius:20px}.plan-card h3{font-size:20px;margin-bottom:4px}.plan-tagline{color:#6b7280;font-size:13px;margin-bottom:12px;min-height:18px}.plan-price{margin-bottom:12px}.plan-amount{font-size:30px;font-weight:700;color:#111827}.plan-period{color:#6b7280;font-size:13px}.plan-description{font-size:13px;color:#4b5563;margin-bottom:8px}.plan-features{font-size:13px;color:#374151;flex:1;margin-bottom:16px}.plan-features ul{padding-left:18px;margin:0}.plan-features li{margin-bottom:4px}.plan-card button,.btn-primary{padding:11px;background:#1e3a8a;color:#fff;border:none;border-radius:6px;font-weight:600;cursor:pointer;font-size:14px}.plan-card button:hover,.btn-primary:hover{background:#1e40af}.staff-strip{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px}.staff-chip{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:10px 14px;cursor:pointer;min-width:130px;box-shadow:0 1px 2px #0000000d;text-align:left}.staff-chip:hover{border-color:#1e3a8a}.staff-chip.active{border-color:#1e3a8a;background:#eef2ff}.staff-chip .chip-name{font-weight:600;font-size:13px;color:#111827}.staff-chip .chip-count{font-size:20px;font-weight:700;color:#1e3a8a}.staff-chip .chip-role{font-size:11px;color:#6b7280}.staff-chip.unassigned .chip-count{color:#dc2626}.assign-bar{background:#fff;border:1px solid #c7d2fe;border-radius:10px;padding:14px 16px;margin-bottom:14px;display:flex;flex-wrap:wrap;gap:10px;align-items:center}.assign-bar strong{font-size:14px}.assign-bar button{padding:8px 14px;background:#1e3a8a;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:13px}.assign-bar button.secondary{background:#fff;color:#1e3a8a;border:1px solid #1e3a8a}.assign-bar button:disabled{opacity:.5;cursor:not-allowed}.team-picker{display:flex;flex-wrap:wrap;gap:8px;width:100%}.team-picker label{display:flex;align-items:center;gap:6px;background:#f3f4f6;padding:5px 10px;border-radius:20px;font-size:13px;cursor:pointer}.team-picker input{width:auto!important;min-width:0!important;flex:0!important}.badge-unassigned{background:#fee2e2;color:#991b1b}.badge-staff{background:#dcfce7;color:#166534}.filter-row{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px;align-items:center}.filter-row input,.filter-row select{padding:8px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px}.assign-select{padding:5px 8px!important;font-size:13px;max-width:170px}.import-options{background:#f9fafb;border:1px dashed #c7d2fe;border-radius:8px;padding:12px 14px;margin-top:12px}.import-options label.radio{display:flex;align-items:center;gap:8px;font-size:14px;margin:6px 0;cursor:pointer}.import-options input[type=radio]{width:auto;min-width:0;flex:0}.import-summary{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0}.import-summary div{background:#f3f4f6;border-radius:8px;padding:8px 14px;font-size:13px}.import-summary b{display:block;font-size:18px;color:#1e3a8a}.alert-warn{background:#fef9c3;color:#854d0e;padding:8px 12px;border-radius:6px;font-size:13px;margin-bottom:8px}.btn-danger-solid{padding:9px 16px;background:#dc2626;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600}.btn-danger-solid:hover{background:#b91c1c}.lead-form h3{font-size:16px;color:#1f2937}.lead-form .field-inline input,.lead-form .field-inline select,.lead-form .field-inline textarea{width:100%;font-weight:400;color:#111827}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a8c;display:flex;align-items:flex-start;justify-content:center;padding:40px 16px;overflow-y:auto;z-index:1000}.modal-box{background:#fff;border-radius:12px;width:100%;max-width:560px;box-shadow:0 20px 50px #00000059}.modal-box.modal-wide{max-width:820px}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e5e7eb}.modal-head h3{margin:0;font-size:18px;color:#111827}.modal-x{background:none;border:none;font-size:26px;line-height:1;cursor:pointer;color:#6b7280;padding:0 4px}.modal-x:hover{color:#111827}.modal-body{padding:18px 20px 20px}.record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.record-field{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:600;color:#4b5563}.record-field.full{grid-column:1 / -1}.record-field.check{flex-direction:row;align-items:center;gap:8px}.record-field input:not([type=checkbox]),.record-field select,.record-field textarea{padding:9px 11px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;font-weight:400;color:#111827;width:100%;font-family:inherit}.record-field small{font-weight:400;color:#6b7280}.record-actions{display:flex;gap:10px;margin-top:18px}.record-actions button{padding:9px 20px;background:#1e3a8a;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:14px}.record-actions .btn-secondary{background:#e5e7eb;color:#111827}.record-actions button:disabled{opacity:.6;cursor:not-allowed}.row-actions-cell{display:flex;gap:6px;flex-wrap:nowrap;white-space:nowrap}.row-actions-cell .btn-small{margin:0}.badge-unassigned{background:#fef3c7;color:#92400e}.filter-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;align-items:center}.filter-chip{padding:6px 14px;border-radius:20px;border:1px solid #d1d5db;background:#fff;color:#374151;font-size:13px;font-weight:600;cursor:pointer}.filter-chip.on{background:#1e3a8a;border-color:#1e3a8a;color:#fff}.row-overdue td{background:#fef2f2}@media (max-width: 640px){.record-grid{grid-template-columns:1fr}.modal-backdrop{padding:12px 8px}}.bar-row{display:grid;grid-template-columns:minmax(90px,32%) 1fr auto;gap:10px;align-items:center;margin:8px 0;font-size:13px}.bar-label{color:#374151;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-track{background:#e5e7eb;border-radius:6px;height:12px;overflow:hidden}.bar-fill{background:#2563eb;height:100%;border-radius:6px}.bar-value{color:#111827;font-weight:600;white-space:nowrap}:root{--brand: #1e3a8a;--brand-2: #0ea5e9;--line: #e5e7eb}html{-webkit-text-size-adjust:100%}img{max-width:100%}button,input,select,textarea{font-family:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.app-shell{min-height:100vh}.sidebar{flex-shrink:0;position:sticky;top:0;height:100vh}.sidebar nav{min-height:0}.sidebar-brand{display:flex;align-items:center;justify-content:space-between}.sidebar-close,.nav-toggle,.nav-backdrop{display:none}.app-content{min-width:0}.app-content>.page{max-width:1500px;margin:0 auto}.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.data-table th{white-space:nowrap}.card-grid{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.topbar-bell{white-space:nowrap;font-size:14px;font-weight:600}.page-header h1,.page>h1{overflow-wrap:anywhere}.page-header h3{margin:0}.panel{min-width:0}.panel h3{overflow-wrap:anywhere}.badge.status-paid{background:#dcfce7;color:#166534}.badge.status-partial{background:#fef3c7;color:#92400e}.badge.status-unpaid{background:#e0e7ff;color:#3730a3}.badge.status-overdue{background:#fee2e2;color:#991b1b}.badge.status-cancelled,.badge.status-refunded{background:#f3f4f6;color:#4b5563}.title-stack{display:flex;flex-direction:column;gap:2px;min-width:0}.title-stack h1{margin:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.back-link{font-size:13px;color:var(--brand);font-weight:600}.pay-row{display:flex;justify-content:space-between;gap:8px;align-items:center;flex-wrap:wrap}.check-inline{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#374151;cursor:pointer}@media (max-width: 1100px){.app-content{padding:22px}.sidebar{width:210px}.two-col,.portal-grid{gap:16px}}@media (max-width: 900px){.app-shell:not(.portal-shell)>.sidebar{position:fixed;top:0;left:0;bottom:0;height:100dvh;width:280px;max-width:86vw;z-index:1100;transform:translate(-102%);transition:transform .22s ease;box-shadow:none}.app-shell.nav-open>.sidebar{transform:none;box-shadow:0 0 40px #00000073}.nav-backdrop{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a8c;opacity:0;pointer-events:none;transition:opacity .2s;z-index:1050}.app-shell.nav-open .nav-backdrop{opacity:1;pointer-events:auto}.app-shell:not(.portal-shell) .sidebar-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;background:#1f2937;color:#fff;border:0;border-radius:8px;font-size:22px;line-height:1;cursor:pointer}.nav-toggle{display:inline-flex;flex-direction:column;justify-content:center;gap:4px;width:42px;height:40px;flex:0 0 auto;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:0 11px;cursor:pointer}.nav-toggle span{display:block;height:2px;background:#1f2937;border-radius:2px}.app-content{padding:16px;width:100%}.topbar{margin-bottom:14px}.topbar-search{max-width:none}.two-col,.portal-grid{grid-template-columns:1fr}.page h1{font-size:22px}.portal-shell{flex-direction:column}.portal-sidebar{position:static;width:100%;height:auto;padding:8px 0 0;flex-direction:column}.portal-sidebar .sidebar-brand{padding:6px 16px 8px}.portal-sidebar nav{display:flex;overflow-x:auto;flex:none;padding:0 8px}.portal-sidebar .nav-link{white-space:nowrap;padding:10px 14px}.portal-sidebar .sidebar-footer{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-top:0;padding:10px 16px}.portal-sidebar .sidebar-footer .btn-logout{width:auto;padding:8px 16px}.portal-sidebar .portal-avatar{margin:0}.data-table:not(.stack){display:block;overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}.data-table:not(.stack) th,.data-table:not(.stack) td{white-space:nowrap}.landing-page{padding:32px 16px}}@media (max-width: 640px){body{font-size:15px}.app-content{padding:12px 12px 28px}.page h1{font-size:20px}.bell-label{display:none}.topbar-bell{padding:8px 11px;font-size:16px}.topbar-search input,input,select,textarea{font-size:16px}.page-header{flex-wrap:wrap;align-items:flex-start}.page-header>button,.page-header>a{flex:0 0 auto}.page-header input{min-width:0;width:100%}.inline-form{padding:14px;gap:10px}.inline-form input,.inline-form select,.inline-form textarea,.inline-form .field-inline,.filter-row input,.filter-row select{flex:1 1 100%;min-width:0!important;width:100%}.inline-form button,.assign-bar button{width:100%;padding:11px}.inline-form .btn-small{width:auto}.filter-row{gap:8px}.filter-chip{padding:8px 12px}.btn-small{padding:7px 12px;font-size:13px}.record-actions{flex-direction:column-reverse}.record-actions button{width:100%;padding:12px}.panel{padding:14px}.card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat-card{padding:12px}.stat-value{font-size:22px}.staff-strip{gap:8px}.staff-chip{min-width:calc(50% - 4px);flex:1 1 calc(50% - 4px)}.assign-select{max-width:none}.team-picker{gap:6px}.modal-box,.modal-box.modal-wide{max-width:100%}.modal-body{padding:14px}.portal-card{flex-direction:column;align-items:flex-start}.portal-row{flex-wrap:wrap}.table-wrap{background:transparent;box-shadow:none;border-radius:0;overflow:visible}.data-table.stack,.data-table.stack tbody{display:block;width:100%}.data-table.stack thead{display:none}.data-table.stack tr{display:block;background:#fff;border:1px solid var(--line);border-radius:12px;padding:4px 14px;margin:0 0 10px;box-shadow:0 1px 2px #0000000a}.data-table.stack td{display:flex;justify-content:space-between;align-items:center;gap:14px;text-align:right;padding:9px 0;border-bottom:1px dashed #eceff3;font-size:14px;overflow-wrap:anywhere}.data-table.stack td:last-child{border-bottom:0}.data-table.stack td:before{content:attr(data-label);flex:0 0 38%;max-width:38%;text-align:left;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#6b7280}.data-table.stack td:empty{display:none}.data-table.stack tr.empty-row td{justify-content:center;text-align:center}.data-table.stack tr.empty-row td:before{display:none}.data-table.stack .row-actions,.data-table.stack .row-actions-cell{justify-content:flex-end;flex-wrap:wrap;white-space:normal}.row-overdue{background:#fef2f2}.day-row .day-no{max-width:none!important}.doc-toolbar{padding:12px}.doc-actions{width:100%}.doc-actions>button{flex:1 1 auto}.login-page{padding:16px;align-items:flex-start;padding-top:8vh}.login-card{width:100%;max-width:380px;padding:26px 20px}.landing-hero h1{font-size:24px}.plan-grid{gap:18px}.plan-card{width:100%;max-width:360px}.plan-card.featured{transform:none}[style*="width: 360px"]{width:92vw!important;max-width:360px}input[style*="width: 220px"]{width:100%!important}}@media (max-width: 380px){.card-grid{grid-template-columns:1fr}.staff-chip{min-width:100%;flex-basis:100%}}.doc-toolbar{background:#fff;border-radius:10px;padding:12px 16px;box-shadow:0 1px 3px #00000014;margin-bottom:12px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.doc-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.doc-actions>button,.page-header .doc-actions>button{padding:9px 18px;background:var(--brand);color:#fff;border:1px solid var(--brand);border-radius:6px;font-weight:600;cursor:pointer;font-size:14px}.doc-actions>.btn-secondary,.page-header .doc-actions>.btn-secondary{background:#fff;color:var(--brand)}.doc-actions>.btn-small,.page-header .doc-actions>.btn-small{padding:6px 12px;font-size:12px;margin:0;border:0;color:#fff;background:#1e3a8a}.doc-actions>.btn-small.btn-danger{background:#dc2626}.doc-actions>button:disabled{opacity:.6;cursor:wait}.doc-scroll{container-type:inline-size;background:#e8ecf2;border-radius:12px;padding:22px 14px}.doc-sheet{position:relative;overflow:hidden;display:flex;flex-direction:column;width:100%;max-width:210mm;min-height:297mm;margin:0 auto;background:#fff;border-top:6px solid var(--brand);padding:14mm 15mm 10mm;box-shadow:0 6px 24px #0f172a26;color:#1f2937}.doc-sheet.mini{min-height:0;padding:14px 18px;box-shadow:0 1px 6px #0000001f;max-width:100%}.settings-form{display:flex;flex-direction:column;gap:16px}.settings-preview{margin-top:16px}.logo-row{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.logo-box{width:150px;height:84px;border:1px dashed #cbd5e1;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#f8fafc;color:#94a3b8;font-size:12px;padding:6px}.logo-box img{max-width:100%;max-height:100%;object-fit:contain}.doc-head,.doc-foot,.invoice-sheet{font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif}.doc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;padding-bottom:14px;margin-bottom:20px;border-bottom:2px solid var(--brand)}.doc-brand{display:flex;align-items:center;gap:16px;min-width:0}.doc-logo{max-height:72px;max-width:190px;object-fit:contain;flex:0 0 auto}.doc-brand-text{min-width:0}.doc-company{font-size:21px;font-weight:800;color:var(--brand);line-height:1.2;overflow-wrap:anywhere}.doc-address{font-size:12.5px;color:#475569;margin-top:3px;white-space:pre-line;line-height:1.45}.doc-contact{font-size:12px;color:#64748b;margin-top:2px;overflow-wrap:anywhere}.doc-head-right{text-align:right;flex:0 0 auto}.doc-foot{margin-top:auto;padding-top:12px;border-top:1px solid #e5e7eb;text-align:center;font-size:11.5px;color:#64748b;line-height:1.5}.doc-foot-text{font-weight:600;color:#334155}.letter-sheet>.doc-foot,.invoice-sheet>.doc-foot{margin-top:auto}.letter-sheet .lt-body{margin-bottom:26px}.invoice-sheet>.inv-end{margin-bottom:24px}.letter-sheet{font-family:Georgia,Times New Roman,serif;font-size:11.5pt;line-height:1.62}.lt-body{flex:1 0 auto}.lt-body[contenteditable]:focus{outline:2px dashed #93c5fd;outline-offset:6px;border-radius:4px}.lt-body p{margin:0 0 11px;text-align:justify}.lt-body ul,.lt-body ol{margin:0 0 12px;padding-left:22px}.lt-body li{margin-bottom:4px}.lt-ref{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:10.5pt;color:#374151;margin-bottom:18px}.lt-to{margin-bottom:14px;line-height:1.5}.lt-subject{font-weight:700;background:#eef2f9;border-left:4px solid var(--brand);padding:8px 12px;margin:14px 0 16px!important;text-align:left!important}.lt-title{text-align:center!important;font-weight:700;font-size:16pt;letter-spacing:.14em;color:var(--brand);margin:6px 0 4px!important}.lt-title:after{content:"";display:block;width:70px;height:3px;background:var(--brand-2);margin:8px auto 0;border-radius:2px}.lt-sub{text-align:center!important;color:#475569;margin:0 0 14px!important}.lt-heading{font-weight:700;color:var(--brand);text-transform:uppercase;letter-spacing:.06em;font-size:10pt;margin:16px 0 4px!important;text-align:left!important}.lt-table,.lt-itinerary{width:100%;border-collapse:collapse;margin:10px 0 14px;font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:10pt;line-height:1.4}.lt-table th,.lt-table td{border:1px solid #d5dce6;padding:6px 10px;text-align:left;vertical-align:top}.lt-table th{background:#f1f5f9;color:#475569;font-size:9pt;text-transform:uppercase;letter-spacing:.04em;width:18%;white-space:nowrap}.lt-itinerary th{background:var(--brand);color:#fff;padding:7px 8px;text-align:left;font-size:9pt;text-transform:uppercase;letter-spacing:.04em;border:1px solid var(--brand)}.lt-itinerary td{border:1px solid #d5dce6;padding:6px 8px;vertical-align:top}.lt-itinerary tbody tr:nth-child(2n) td{background:#f8fafc}.lt-itinerary .c{text-align:center;width:44px;font-weight:700}.lt-box{border:1px solid #cbd5e1;border-left:4px solid var(--brand);background:#f8fafc;border-radius:6px;padding:10px 14px;margin:14px 0;font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:10.5pt}.lt-box .lt-table{margin-bottom:4px;background:#fff}.lt-box p{font-family:Georgia,serif}.lt-sign{margin-top:26px;break-inside:avoid}.lt-sign p{margin-bottom:0}.lt-sign-space{height:46px}.lt-stamp{display:inline-block;margin-top:12px;border:1px dashed #94a3b8;padding:14px 28px;color:#94a3b8;font-size:9pt;font-family:Segoe UI,Arial,sans-serif}.lt-enclosures{margin-top:22px;padding-top:8px;border-top:1px dashed #cbd5e1;font-size:10pt;color:#4b5563}.lt-note{font-style:italic;color:#64748b;font-size:10pt;text-align:left!important}.lt-approval{margin-top:24px}.lt-approval-sign{display:flex;justify-content:space-between;gap:16px;margin-top:38px;font-size:9.5pt;color:#64748b}.lt-approval-sign span{flex:1;border-top:1px solid #64748b;padding-top:4px;text-align:center}.lt-blank{background:#fde68a;color:#92400e;border-radius:3px;padding:0 4px;font-family:Segoe UI,Arial,sans-serif;font-size:.88em}.template-form .record-grid{margin-bottom:8px}.var-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:10px 0 4px}.chip{border:1px solid #c7d2fe;background:#eef2ff;color:#3730a3;border-radius:99px;padding:3px 10px;font-size:12px;cursor:pointer}.chip:hover{background:#e0e7ff}.tabs-mini{display:flex;gap:4px;margin-bottom:8px}.tabs-mini button{padding:6px 16px;border:1px solid #d1d5db;background:#fff;border-radius:6px;cursor:pointer;font-weight:600;color:#374151}.tabs-mini button.on{background:var(--brand);border-color:var(--brand);color:#fff}.template-body{width:100%;font-family:ui-monospace,Consolas,Menlo,monospace;font-size:13px;line-height:1.5;padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;resize:vertical;min-height:280px}.preview-sheet{min-height:0}.invoice-sheet{font-size:13px;line-height:1.5}.inv-titlebox{text-align:right}.inv-title{font-size:28px;font-weight:800;letter-spacing:.07em;color:var(--brand);line-height:1}.inv-meta{margin:10px 0 0 auto;border-collapse:collapse;font-size:12.5px}.inv-meta th{color:#6b7280;font-weight:600;text-align:left;padding:2px 14px 2px 0}.inv-meta td{text-align:right;font-weight:600;padding:2px 0}.inv-status{display:inline-block;padding:1px 10px;border-radius:99px;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:#e0e7ff;color:#3730a3}.inv-status.status-paid{background:#dcfce7;color:#166534}.inv-status.status-partial{background:#fef3c7;color:#92400e}.inv-status.status-overdue{background:#fee2e2;color:#991b1b}.inv-status.status-cancelled,.inv-status.status-refunded{background:#f3f4f6;color:#4b5563}.inv-parties{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:4px 0 20px}.inv-party{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:12px 14px;line-height:1.6;overflow-wrap:anywhere}.inv-label{font-size:10.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#64748b;margin-bottom:4px}.inv-name{font-weight:700;font-size:15px;color:#0f172a}.inv-items{width:100%;border-collapse:collapse;margin-top:4px}.inv-items th{background:var(--brand);color:#fff;text-align:left;padding:9px 12px;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em}.inv-items td{padding:10px 12px;border-bottom:1px solid #e5e7eb}.inv-items .c{text-align:center;width:48px}.inv-items .r{text-align:right}.inv-items.small{font-size:12px;margin-top:4px}.inv-items.small th{background:#334155;padding:7px 10px}.inv-items.small td{padding:7px 10px}.inv-bottom{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-top:14px}.inv-notes{flex:1;min-width:0;font-size:12.5px;color:#475569}.inv-notes p{margin:0 0 10px}.pre{white-space:pre-line}.inv-totals{width:300px;flex:0 0 auto;border-collapse:collapse}.inv-totals td{padding:6px 12px}.inv-totals td:last-child{text-align:right;font-weight:600;white-space:nowrap}.inv-totals .grand td{background:#eef2ff;font-weight:800;font-size:15px;color:var(--brand);border-top:2px solid var(--brand)}.inv-totals .due td{font-weight:800;font-size:14px;color:#b91c1c;border-top:1px solid #cbd5e1}.inv-totals .due.settled td{color:#15803d}.inv-payments{margin-top:18px}.inv-end{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-top:28px}.inv-terms{flex:1;min-width:0;font-size:11.5px;color:#475569}.inv-terms p{margin:0}.inv-sign{width:220px;flex:0 0 auto;text-align:center;font-size:12px}.inv-sign-space{height:48px}.inv-sign-line{border-top:1px solid #334155;padding-top:6px;font-weight:700}.inv-stamp{position:absolute;top:42%;left:50%;transform:translate(-50%,-50%) rotate(-18deg);font-size:88px;font-weight:900;letter-spacing:.08em;border:9px solid currentColor;padding:0 28px;border-radius:16px;opacity:.08;pointer-events:none;white-space:nowrap;z-index:0}.stamp-paid{color:#15803d}.stamp-cancelled,.stamp-refunded{color:#dc2626}.invoice-sheet>*:not(.inv-stamp){position:relative;z-index:1}@container (max-width: 640px){.doc-sheet{min-height:0;padding:18px 16px 14px}.doc-head{flex-direction:column;gap:14px}.doc-brand{flex-wrap:wrap;gap:10px}.doc-head-right,.inv-titlebox{text-align:left}.inv-meta{margin-left:0}.inv-title{font-size:22px}.inv-parties{grid-template-columns:1fr}.inv-bottom,.inv-end{flex-direction:column;align-items:stretch}.inv-totals{width:100%}.inv-sign{width:100%;text-align:left;margin-top:8px}.inv-stamp{font-size:46px;border-width:5px}.invoice-sheet .inv-items{font-size:12px}.inv-items.small{display:block;overflow-x:auto}.inv-items.small th,.inv-items.small td{white-space:nowrap}.letter-sheet{font-size:11pt}.lt-body p{text-align:left}.lt-table th{width:auto;white-space:normal}.lt-table,.lt-itinerary{display:block;overflow-x:auto}.lt-itinerary th,.lt-itinerary td{white-space:nowrap}}@media (max-width: 640px){.doc-scroll{padding:8px 4px;border-radius:8px}}.pdf-host{position:fixed;left:-10000px;top:0;width:794px;background:#fff;z-index:-1}.doc-sheet.pdf-mode{width:794px;max-width:none;min-height:0;margin:0;box-shadow:none;padding:6mm 14mm 2mm;border-top-width:6px}.doc-sheet.pdf-mode .lt-blank{background:transparent}@page{size:A4;margin:12mm}@media print{*{-webkit-print-color-adjust:exact;print-color-adjust:exact}html,body{background:#fff!important;height:auto!important;font-size:12pt}.sidebar,.topbar,.trial-banner,.nav-backdrop,.no-print,.nav-toggle{display:none!important}.app-shell{display:block!important;min-height:0!important}.app-content{display:block!important;padding:0!important;overflow:visible!important;width:auto!important}.app-content>.page,.page{max-width:none!important;margin:0!important;padding:0!important}body.printing-one .doc-sheet:not(.print-me){display:none!important}.doc-scroll{padding:0!important;background:none!important;border-radius:0!important;container-type:normal!important;overflow:visible!important}.doc-sheet{box-shadow:none!important;width:100%!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;border-top-width:5px;overflow:visible!important;display:block!important}.doc-sheet .doc-foot{margin-top:24px}.lt-body[contenteditable]:focus{outline:none!important}.lt-blank{background:transparent!important;color:#000!important}.doc-head,.lt-sign,.lt-box,.inv-parties,.inv-totals,.inv-end,.inv-payments,.doc-foot,.avoid-break,tr,img{break-inside:avoid;page-break-inside:avoid}thead{display:table-header-group}.inv-stamp{opacity:.09}.lt-table,.lt-itinerary,.inv-items.small{display:table!important;overflow:visible!important}}.pdf-mode .lt-body,.pdf-mode .inv-end{margin-bottom:6px}.pdf-mode .doc-foot{margin-top:10px;padding-top:8px}.pdf-mode .inv-end{margin-top:16px}.pdf-mode .inv-sign-space,.pdf-mode .lt-sign-space{height:34px}.pdf-mode .inv-items td{padding:8px 12px}.pdf-mode .doc-head{margin-bottom:14px;padding-bottom:10px}@media print{.doc-sheet .lt-body,.doc-sheet .inv-end{margin-bottom:4px!important}.doc-sheet .doc-foot{margin-top:10px!important;padding-top:8px}.doc-sheet .inv-end{margin-top:16px}.inv-sign-space,.lt-sign-space{height:34px}.inv-items td{padding:8px 12px}.doc-head{margin-bottom:14px;padding-bottom:10px}}.doc-sheet.pdf-mode{display:block;height:auto;overflow:visible}
