/* RanSan Obsidian — additive theme, existing IDs and business logic retained. */
:root{color-scheme:dark;--rs-bg:#080a0e;--rs-panel:#12161e;--rs-line:rgba(255,255,255,.12);--rs-text:#edf2fa;--rs-muted:#a7b2c4;--rs-accent:#a5b4fc}
*{box-sizing:border-box}html,body{min-height:100%;margin:0}body{background:radial-gradient(ellipse at 10% 0,rgba(99,102,241,.16),transparent 45%),radial-gradient(ellipse at 100% 30%,rgba(34,211,238,.07),transparent 40%),var(--rs-bg)!important;color:var(--rs-text);font-family:Inter,system-ui,sans-serif;line-height:1.5}
.glass,.modal-glass{background:linear-gradient(135deg,rgba(26,32,44,.94),rgba(13,17,24,.96))!important;border:1px solid var(--rs-line)!important;box-shadow:0 16px 48px #0004,inset 0 1px #ffffff08;backdrop-filter:blur(18px);border-radius:20px}
header{background:rgba(10,13,19,.94)!important;border-bottom:1px solid var(--rs-line)!important;color:var(--rs-text)!important}header .text-gray-900{color:var(--rs-text)!important}
main{min-width:0}body>div.grid{padding:16px;max-width:1800px;margin:auto}aside{align-self:start}h1,h2,h3{letter-spacing:-.025em}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button,.btn{touch-action:manipulation;min-height:44px;border-radius:12px;transition:background .18s,border-color .18s;cursor:pointer}.btn{background:#ffffff08;border:1px solid var(--rs-line);color:var(--rs-text)}.btn:hover{background:#ffffff12;border-color:#a5b4fc66}button:disabled{opacity:.5;cursor:wait}
input:not([type=checkbox]):not([type=radio]),select,textarea{color:var(--rs-text)!important;background:#0b1019!important;border:1px solid #ffffff24!important;border-radius:12px;min-height:44px;padding:10px 12px;max-width:100%}select option{background:#121824;color:#edf2fa}input::placeholder,textarea::placeholder{color:#8e9ab0}input[type=checkbox]:not(.env-switch),input[type=radio]{width:24px!important;height:24px!important;min-height:24px!important;flex:0 0 24px;accent-color:#a5b4fc;cursor:pointer;vertical-align:middle}label:has(input[type=checkbox]:not(.env-switch)){min-height:44px;padding:8px;cursor:pointer;border-radius:10px;gap:10px}label:has(input:checked):not(.env-slider){background:#a5b4fc15}
:focus-visible{outline:2px solid #a5b4fc!important;outline-offset:3px}table{width:100%;border-collapse:collapse}th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--rs-muted)}th,td{padding:12px!important;border-bottom:1px solid #ffffff0b}tbody tr:hover{background:#ffffff04}.rs-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}#itemBody input,#itemBody select{min-width:90px}#itemBody .desc{min-width:160px}
.rs-menu,.rs-overlay,.rs-close{display:none}.rs-preview{position:fixed;inset:0;z-index:100000;background:#090c12;display:flex;flex-direction:column}.rs-preview-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px max(16px,env(safe-area-inset-right));border-bottom:1px solid #ffffff24}.rs-preview-bar strong{margin-right:auto}.rs-preview iframe{width:100%;flex:1;border:0;background:white;min-height:0}.rs-preview button{padding:10px 16px;background:#a5b4fc;color:#101525;border:0;font-weight:600}.rs-preview button:last-child{background:#252d3c;color:white}.rs-preview-status{color:#a7b2c4;font-size:12px}.rs-preview[hidden]{display:none}
@media(min-width:1024px){#sidebar{position:sticky;top:96px}body>div.grid{grid-template-columns:250px minmax(0,1fr)!important}#sidebar,main{grid-column:auto!important}}
@media(max-width:1023px){body>div.grid{display:block!important;padding:12px}header>div{padding-left:68px!important;gap:8px;flex-wrap:wrap}header img{max-width:100px}header .text-xl{font-size:15px}#sidebar{position:fixed!important;inset:0 auto 0 0;width:min(320px,88vw)!important;height:100dvh;overflow-y:auto;z-index:10001;transform:translateX(-110%);transition:transform .22s;padding:20px!important;border-radius:0 22px 22px 0}#sidebar.rs-open{transform:translateX(0)}#collapseBtn{display:none}.rs-menu{display:block;position:fixed;left:12px;top:12px;z-index:70;width:44px;background:#1a2130;color:white;border:1px solid #ffffff30;font-size:22px}.rs-close{display:block;margin-bottom:12px;padding:8px 16px;background:#222c3e;color:white;border:0}.rs-overlay.rs-open{display:block;position:fixed;inset:0;z-index:10000;background:#0009}main{padding:0!important}.fixed.inset-0:not(.hidden):not(.rs-preview){padding:12px;overflow:auto}.fixed.inset-0> .glass,.fixed.inset-0> .modal-glass{max-width:100%!important;max-height:90dvh;overflow:auto}input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}#invoiceForm .flex{flex-wrap:wrap}.rs-table-scroll table{min-width:640px}#invoiceForm .rs-table-scroll table{min-width:720px}}
@media(max-width:480px){header>div{padding-right:12px!important}#invoiceForm .grid{gap:12px}.glass{border-radius:16px}th,td{padding:10px!important}.rs-preview-bar{gap:8px}.rs-preview-status{width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{.rs-menu,.rs-overlay,.rs-preview{display:none!important}}
/* v2: viewport-anchored header, contained document overflow */
html{overflow-x:clip}body{overflow-x:clip}body:has(>header){padding-top:var(--rs-header-height,96px)}body>header{position:fixed!important;inset:0 0 auto 0!important;width:100%!important;max-width:100vw;z-index:80!important;margin:0!important;box-shadow:0 8px 32px #0005}body>header>div{max-width:1800px!important;margin:auto;display:flex;flex-wrap:wrap;gap:12px;padding:12px 24px!important;min-width:0}body>header>div>div:first-child{flex:1;min-width:0}body>header h1{display:none!important}.rs-brand-logo{height:48px!important;width:64px!important;max-width:64px!important;object-fit:contain;background:#fff;border-radius:12px;padding:5px;flex-shrink:0}.rs-brand-text{display:flex;flex-direction:column;line-height:1.25;white-space:nowrap}.rs-brand-text small{font-size:10px;letter-spacing:.16em;color:#a7b2c4;text-transform:uppercase;margin-top:4px}#notifBtn,#profileBtn{background:#161e2d!important;border:1px solid #ffffff20!important;color:#edf2fa!important;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}#notifBtn svg,#profileBtn svg{color:#c7d2fe!important}#notifBtn:hover,#profileBtn:hover{background:#252f46!important}#notifBadge{width:9px;height:9px;right:7px;top:6px;background:#fb7185;box-shadow:0 0 0 3px #161e2d}#notifPanel,#profileMenu{background:#111824!important;border:1px solid #ffffff24!important;box-shadow:0 24px 64px #0009;border-radius:18px!important;padding:12px!important;color:#edf2fa;max-height:70dvh;overflow-y:auto}#notifPanel{width:min(360px,calc(100vw - 24px))!important}#notifList li{padding:12px;gap:12px;border:1px solid #ffffff0d;margin-bottom:6px}#profileMenu button[onclick*="logout"]{background:#fb718515;color:#fda4af!important;border:1px solid #fb718538;padding:10px 12px;min-height:44px;width:100%;display:flex;align-items:center;gap:10px}#profileMenu button[onclick*="logout"]:hover{background:#fb71852a}#themeSelect,#colorSelect{font-size:12px!important;max-width:145px}#sidebar{top:calc(var(--rs-header-height,96px) + 12px)}.rs-draft-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 14px;margin-bottom:14px;border:1px solid #a5b4fc35;border-radius:14px;background:#a5b4fc0c}.rs-draft-bar span{flex:1;min-width:160px;color:#b6c5df;font-size:13px}.rs-draft-bar button{padding:8px 12px;background:#242d43;color:#edf2fa;border:1px solid #ffffff20}.rs-payment{margin-top:12px;padding:14px;background:#ffffff04;border:1px solid #ffffff15;border-radius:14px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.rs-payment[hidden]{display:none}.rs-payment label{display:block;font-size:12px;color:#a7b2c4}.rs-payment input,.rs-payment select{width:100%;margin-top:6px}.rs-delivery{padding:12px 14px;border:1px solid #ffffff20;border-radius:12px;margin:12px 0;color:#c7d2fe;font-size:13px}.rs-delivery[data-state=failed],.rs-delivery[data-state=unknown]{color:#fcd34d;border-color:#fcd34d44}.rs-delivery[data-state=accepted]{color:#86efac;border-color:#86efac44}.rs-draft-bar[hidden]{display:none}
@media(max-width:1023px){body>header>div{padding:10px 12px 10px 66px!important;gap:10px}#sidebar{top:0}.rs-brand-logo{height:40px!important;width:48px!important;max-width:48px!important}.rs-brand-text{font-size:15px!important}.rs-brand-text small{font-size:9px}#notifPanel,#profileMenu{position:fixed!important;top:calc(var(--rs-header-height,96px) + 8px)!important;right:12px!important;margin:0!important}body>header>div>div:last-child{gap:8px!important;justify-content:flex-end;flex-wrap:wrap}#themeSelect,#colorSelect{max-width:110px;min-height:36px;padding:6px!important}.rs-payment{grid-template-columns:1fr}}
@media(max-width:480px){body>header>div>.env-toggle{margin-left:auto}body>header>div>div:last-child{width:100%;margin-left:0!important;justify-content:space-between}.rs-brand-text{white-space:normal}.rs-preview{padding-top:0}}
