/* Business documents (invoice / quote / contract) — screen and print.
   Invoices: 12 layouts (.dr-L-*) × colour themes via --ac (accent), --ac2 (dark), --tint (light). */
.dr{--ac:#4F46E5;--ac2:#312E81;--tint:#EEF2FF;position:relative;background:#fff;color:#0B1020;border:1px solid #D8DEE8;border-radius:12px;padding:40px 44px;font:14px/1.55 Inter,system-ui,sans-serif;overflow:hidden;text-align:left}
.dr small{display:block;font-size:.7rem;text-transform:uppercase;letter-spacing:.07em;color:#6B7280;margin-bottom:2px;font-weight:600}
.dr-top{position:relative;display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:28px}
.dr-logo{max-height:60px;max-width:190px;margin-bottom:10px;display:block;object-fit:contain}
.dr-from{font-size:.86rem;color:#374151}.dr-from b{font-size:1.05rem;color:#0B1020}
.dr-title{text-align:right}.dr-title h1{font-size:1.9rem;font-weight:800;letter-spacing:.04em;color:var(--ac);margin:0 0 8px;line-height:1.15}
.dr-title table{margin-left:auto;font-size:.86rem;border-collapse:collapse}.dr-title td{padding:1px 0 1px 14px}.dr-title td:first-child{color:#6B7280}
.dr-body{position:relative}
.dr-to{margin-bottom:24px;font-size:.9rem}.dr-to b{font-size:1rem}
.dr-items{width:100%;border-collapse:collapse;font-size:.9rem}
.dr-items th{text-align:left;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:#fff;background:var(--ac);padding:9px 10px}
.dr-items td{padding:10px;border-bottom:1px solid #E5E7EB;vertical-align:top}
.dr-items .r{text-align:right;white-space:nowrap}
.dr-tot{margin:14px 0 0 auto;width:280px;display:grid;gap:4px;font-size:.92rem}
.dr-tot div{display:flex;justify-content:space-between}.dr-tot .g{border-top:2px solid var(--ac);padding-top:8px;margin-top:4px;font-weight:800;font-size:1.1rem}
.dr-note{margin-top:20px;font-size:.86rem;color:#374151}
.dr-foot{margin-top:32px;text-align:center;color:#9CA3AF;font-size:.8rem}
.dr-deco{display:none}
.dr-stamp{position:absolute;bottom:90px;left:44px;transform:rotate(-12deg);border:3px solid;border-radius:8px;padding:4px 16px;font-weight:800;font-size:1.3rem;letter-spacing:.1em;opacity:.8;z-index:3}

/* Classic — serif, ruled */
.dr-classic,.dr-L-classic{font-family:Georgia,'Times New Roman',serif}
.dr-classic .dr-items th,.dr-L-classic .dr-items th{background:transparent;color:#0B1020;border-bottom:2px solid var(--ac)}
.dr-L-classic .dr-title h1{color:var(--ac2);font-weight:700}.dr-L-classic .dr-top{border-bottom:1px solid var(--ac);padding-bottom:18px}
/* Minimal — airy, thin */
.dr-L-minimal .dr-items th{background:transparent;color:#6B7280;border-bottom:1px solid #D1D5DB}.dr-L-minimal .dr-title h1{font-weight:300;letter-spacing:.22em;color:var(--ac2)}.dr-L-minimal .dr-tot .g{border-top-width:1px}.dr-L-minimal .dr-items td{border-bottom-color:#F1F5F9}
/* Bold header band */
.dr-L-bold .dr-top{background:var(--ac);color:#fff;margin:-40px -44px 28px;padding:36px 44px}.dr-L-bold .dr-top *{color:#fff!important}.dr-L-bold .dr-title td:first-child{opacity:.8}.dr-L-bold .dr-items th{background:var(--ac2)}
/* Sidebar — coloured left column */
.dr-L-sidebar{display:grid;grid-template-columns:200px minmax(0,1fr);padding:0}
.dr-L-sidebar .dr-top{flex-direction:column;justify-content:flex-start;margin:0;padding:36px 22px;background:var(--ac2);color:#fff;gap:28px}
.dr-L-sidebar .dr-top *{color:#fff!important}.dr-L-sidebar .dr-title{text-align:left}.dr-L-sidebar .dr-title h1{font-size:1.45rem}.dr-L-sidebar .dr-title table{margin-left:0}.dr-L-sidebar .dr-title td{padding:2px 12px 2px 0;display:block}.dr-L-sidebar .dr-title td:first-child{opacity:.7;font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;padding-top:8px}
.dr-L-sidebar .dr-body{padding:36px 34px}.dr-L-sidebar .dr-items th{background:var(--tint);color:var(--ac2)}.dr-L-sidebar .dr-logo{background:#fff;border-radius:8px;padding:6px}
/* Corporate — top rule, tinted boxes */
.dr-L-corporate{border-top:10px solid var(--ac)}.dr-L-corporate .dr-title table{background:var(--tint);border-radius:8px;padding:8px 12px}.dr-L-corporate .dr-title td{padding:3px 6px}
.dr-L-corporate .dr-to{background:var(--tint);border-left:4px solid var(--ac);padding:12px 16px;border-radius:0 8px 8px 0}.dr-L-corporate .dr-items th{background:var(--ac2)}.dr-L-corporate .dr-items tbody tr:nth-child(even) td{background:#F8FAFC}
/* Elegant — centred serif */
.dr-L-elegant{font-family:Georgia,'Times New Roman',serif}.dr-L-elegant .dr-top{flex-direction:column;align-items:center;text-align:center;gap:12px}
.dr-L-elegant .dr-title{text-align:center}.dr-L-elegant .dr-title h1{font-weight:400;letter-spacing:.3em;color:var(--ac2);border-top:3px double var(--ac);border-bottom:3px double var(--ac);padding:8px 26px}.dr-L-elegant .dr-title table{margin:0 auto}
.dr-L-elegant .dr-logo{margin:0 auto 8px}.dr-L-elegant .dr-items th{background:transparent;color:var(--ac2);border-top:1px solid var(--ac);border-bottom:1px solid var(--ac)}
/* Stripes — diagonal corner */
.dr-L-stripe .dr-deco{display:block;position:absolute;top:0;right:0;width:260px;height:150px;background:repeating-linear-gradient(135deg,var(--ac) 0 10px,transparent 10px 22px);-webkit-mask-image:linear-gradient(225deg,#000 20%,transparent 70%);mask-image:linear-gradient(225deg,#000 20%,transparent 70%);opacity:.9}
.dr-L-stripe .dr-items th{background:var(--tint);color:var(--ac2)}.dr-L-stripe .dr-tot .g{background:var(--ac);color:#fff;border:0;padding:8px 10px;border-radius:6px}
/* Wave — curved header */
.dr-wave{position:absolute;left:0;top:0;width:100%;height:240px;display:block}
.dr-L-wave .dr-top{padding-top:0;min-height:190px;margin-bottom:34px}.dr-L-wave .dr-title h1,.dr-L-wave .dr-title td{color:#fff!important}.dr-L-wave .dr-title td:first-child{opacity:.8}
.dr-L-wave .dr-brand{background:#fff;border-radius:10px;padding:10px 12px;box-shadow:0 6px 20px rgba(0,0,0,.08);margin-top:34px}
.dr-L-wave .dr-items th{background:var(--ac2)}.dr-L-wave .dr-foot{color:var(--ac)}
/* Split — two-tone header */
.dr-L-split .dr-top{margin:-40px -44px 28px;padding:0;align-items:stretch;gap:0}.dr-L-split .dr-brand{flex:1;padding:34px 44px;background:var(--tint)}
.dr-L-split .dr-title{flex:1;padding:34px 44px;background:var(--ac);color:#fff}.dr-L-split .dr-title h1,.dr-L-split .dr-title td{color:#fff!important}.dr-L-split .dr-title td:first-child{opacity:.8}.dr-L-split .dr-items th{background:var(--ac2)}
/* Typewriter — monospace receipt style */
.dr-L-mono{font-family:'Courier New',ui-monospace,monospace;font-size:13px}.dr-L-mono .dr-top{border-bottom:2px dashed #0B1020;padding-bottom:16px}
.dr-L-mono .dr-title h1{font-weight:700;letter-spacing:.2em;color:#0B1020;text-decoration:underline;text-decoration-color:var(--ac);text-decoration-thickness:3px;text-underline-offset:6px}
.dr-L-mono .dr-items th{background:transparent;color:#0B1020;border-bottom:1px dashed #0B1020;border-top:1px dashed #0B1020}.dr-L-mono .dr-items td{border-bottom:1px dotted #9CA3AF}.dr-L-mono .dr-tot .g{border-top:2px dashed var(--ac)}
/* Framed — inset border with corner marks */
.dr-L-frame{padding:52px 56px}.dr-L-frame .dr-deco{display:block;position:absolute;inset:14px;border:2px solid var(--ac);border-radius:6px;pointer-events:none}
.dr-L-frame .dr-deco::before,.dr-L-frame .dr-deco::after{content:"";position:absolute;width:44px;height:44px;border:6px solid var(--ac2)}
.dr-L-frame .dr-deco::before{top:-9px;left:-9px;border-right:0;border-bottom:0}.dr-L-frame .dr-deco::after{bottom:-9px;right:-9px;border-left:0;border-top:0}
.dr-L-frame .dr-items th{background:var(--tint);color:var(--ac2)}

/* Preview watermark (downloads need a subscription or an unlocked invoice) */
.dr-wm{position:absolute;inset:0;pointer-events:none;z-index:4;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='220'%3E%3Ctext x='20' y='130' transform='rotate(-24 170 110)' font-family='Arial' font-size='26' font-weight='700' fill='%230B1020' fill-opacity='.10'%3EPREVIEW · tekservix.com%3C/text%3E%3C/svg%3E");background-repeat:repeat}

.dr-contract h3{font-size:1rem;font-weight:700;margin:16px 0 4px}.dr-contract .dr-meta{color:#6B7280;font-size:.84rem;margin-bottom:16px}
.dr-sigs{display:grid;grid-template-columns:1fr 1fr;gap:28px;margin-top:36px}.dr-sigs div{border-top:1px solid #0B1020;padding-top:6px;display:grid}.dr-sigs b{font-family:'Brush Script MT','Segoe Script',cursive;font-size:1.5rem;font-weight:400;min-height:1.5em}.dr-sigs span{font-size:.76rem;color:#6B7280}

/* Fixed A4 rendering (PDF export and template thumbnails) */
.dr-a4 .dr{width:794px;min-height:1123px;border:0;border-radius:0}
.dr-a4 .dr-L-sidebar{min-height:1123px}

@media (max-width:640px){
  .dr:not(.dr-fixed){padding:22px 18px}.dr:not(.dr-fixed) .dr-top{flex-direction:column}.dr:not(.dr-fixed) .dr-title{text-align:left}.dr:not(.dr-fixed) .dr-title table{margin-left:0}
  .dr-L-bold:not(.dr-fixed) .dr-top,.dr-L-split:not(.dr-fixed) .dr-top{margin:-22px -18px 22px;padding:22px 18px}.dr-L-split:not(.dr-fixed) .dr-brand,.dr-L-split:not(.dr-fixed) .dr-title{padding:18px}
  .dr-L-sidebar:not(.dr-fixed){display:block;padding:0}.dr-L-sidebar:not(.dr-fixed) .dr-body{padding:22px 18px}
  .dr:not(.dr-fixed) .dr-tot{width:100%}.dr:not(.dr-fixed) .dr-items{font-size:.8rem}
}
@media print{
  body *{visibility:hidden}.dr,.dr *{visibility:visible}
  .dr{position:absolute;left:0;top:0;width:100%;border:0;border-radius:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .dr-locked,.dr-locked *{visibility:hidden!important}
}
