/* Shared density and responsive layout for DocuPlay. Loaded after the theme. */
html{scrollbar-gutter:stable}
body{font-size:14px;line-height:1.5}
body:has(dialog[open]){overflow:hidden}
main{min-width:0}
h1{font-size:27px;line-height:1.18;letter-spacing:-.7px}
h2{line-height:1.3}
p{line-height:1.55}
.workspace main{max-width:1500px;padding:26px}
.heading{gap:14px;margin-bottom:20px}
.heading .eyebrow{margin-bottom:6px;font-size:9px}
.heading p:not(.eyebrow){font-size:13px;margin-top:7px}
.card{border-radius:15px}
.panel{padding:20px;margin-bottom:16px}
.panel h2{font-size:17px}
.form-grid{gap:16px;grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid>*{min-width:0}
.panel label{font-size:12px}
.primary,.outline{font-size:13px;padding:9px 13px;min-height:38px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.actions form{margin:0;max-width:100%}
.panel input:not([type=checkbox]),.panel select,.panel textarea{padding:10px 11px;max-width:100%;border-radius:9px;font-size:14px}
.table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.table-wrap th{padding:12px 14px;font-size:10px}
.table-wrap td{padding:13px 14px;font-size:12px;overflow-wrap:anywhere}
.table-wrap td:first-child{width:auto;min-width:140px}
.table-wrap .actions{min-width:145px}
.pricing-toolbar{padding:16px;gap:12px}
.sale-price,.price-input{max-width:130px}
.result-text{max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap}
.sidebar{width:246px;padding:23px 14px 16px}
.sidebar .brand{margin-bottom:20px}
.sidebar .docuplay-logo{width:195px}
.sidebar .balance-box{padding:17px;border-radius:16px;margin-bottom:20px}
.sidebar .balance-box strong{font-size:27px}
.sidebar .balance-actions{margin-top:14px}
.sidebar nav a{font-size:13px;padding:10px 12px;gap:11px;margin-bottom:3px;min-height:42px}
.sidebar .nav-icon{font-size:19px}
.sidebar-bottom .theme-toggle{padding:12px}
.profile-chip{border-radius:11px;gap:8px;padding:5px 9px}
.profile-chip .avatar{width:31px;height:31px;border-radius:9px}
.profile-chip strong{font-size:12px}
.profile-chip small{font-size:10px;margin-top:2px}
.floating-controls{top:12px;right:22px}
.intro-hero,.orders-banner{padding:25px;border-radius:18px}
.intro-hero h2,.orders-banner h2{font-size:27px;margin:8px 0}
.intro-hero p,.orders-banner p{font-size:13px;margin:10px 0 16px}
.intro-hero img,.orders-banner img{width:110px;height:auto}
.metric-grid{gap:12px;margin:18px 0}
.metric{padding:18px}
.metric strong{font-size:25px;margin-top:8px;overflow-wrap:anywhere}
.metric small{font-size:11px}
.intro-steps{gap:12px;margin-bottom:18px}
.intro-steps article{padding:19px}
.intro-steps h3{font-size:15px;margin:12px 0 7px}
.intro-steps span{width:30px;height:30px;border-radius:9px}
.catalog-page .layout{display:block}
.catalog-page .filters{padding:16px}
.catalog-page #search{padding:11px 13px;font-size:14px;border-radius:10px}
.catalog-page .chips{gap:6px;margin-top:12px}
.catalog-page .chip{font-size:11px;padding:7px 10px;min-height:32px}
.section-heading{margin:19px 0 12px}
.service-grid{grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:13px}
.service.card,.service.card.selected{min-height:0;padding:17px;border:1px solid var(--line);border-radius:14px}
.service.card.selected{border-color:var(--accent)}
.service-top{gap:8px;margin-bottom:12px}
.service .icon{width:32px;height:32px;font-size:19px;border-radius:10px}
.service .category{padding:4px 7px;font-size:9px}
.service .service-name{font-size:14px;line-height:1.4;margin-bottom:7px}
.service .service-info{font-size:11px;line-height:1.5;margin:0 0 12px;-webkit-line-clamp:2}
.service .delivery{font-size:10px;max-width:100%}
.service-bottom{gap:7px;padding-top:10px}
.service .price{font-size:21px;font-weight:650;line-height:1.2}
.service-bottom:after{width:30px;height:30px;font-size:18px}
.wholesaler-layout .service-retail{font-size:10px;padding:8px 0}
.wholesaler-layout .service-retail strong{font-size:12px}
.capture-dialog{box-sizing:border-box;width:min(620px,calc(100% - 32px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);margin:auto;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);overflow:auto;overscroll-behavior:contain;box-shadow:0 24px 90px #0712264d}
.capture-dialog::backdrop,.order-dialog::backdrop{background:#06132f99;backdrop-filter:blur(4px)}
.capture-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}
.capture-header .eyebrow{font-size:9px;margin:0 0 5px}
.capture-header h2{font-size:23px;margin:0;outline:none}
.capture-close{border:1px solid var(--line);background:var(--soft);color:var(--ink);width:38px;height:38px;border-radius:50%;font-size:25px;flex-shrink:0;line-height:1;cursor:pointer}
.capture-service{font-size:14px;line-height:1.5;font-weight:650;margin:0 0 11px;overflow-wrap:anywhere}
.capture-pricing{display:flex;flex-wrap:wrap;gap:8px;font-size:12px;margin-bottom:15px}
.capture-pricing span{padding:7px 10px;background:var(--soft);border:1px solid var(--line);border-radius:9px;font-weight:650}
.capture-pricing #capture-retail{color:var(--accent)}
.capture-dialog #service-notice{margin:0 0 17px;padding:12px;background:var(--soft);border:1px solid var(--line);border-left:3px solid var(--accent);color:var(--muted);font-size:12px;border-radius:9px;white-space:pre-line;overflow-wrap:anywhere;max-height:155px;overflow-y:auto}
.capture-dialog .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0 0 14px}
.capture-dialog .fields>div:only-child{grid-column:1/-1}
.capture-dialog .fields>div{min-width:0}
.capture-dialog .fields label{display:block;font-size:12px;margin-bottom:7px;color:var(--ink)}
.capture-dialog .fields input,.capture-dialog .fields select,.capture-dialog .fields textarea{box-sizing:border-box;max-width:100%;width:100%;font:inherit;font-size:15px;min-height:43px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--ink)}
.capture-dialog .fields input:focus,.capture-dialog .fields select:focus,.capture-dialog .fields textarea:focus{outline:2px solid var(--accent);outline-offset:2px}
.capture-dialog .fields textarea{min-height:100px;resize:vertical}
.capture-dialog #order-message{font-size:13px;overflow-wrap:anywhere;color:var(--accent);margin:10px 0}
.capture-actions{display:flex;gap:9px;justify-content:flex-end;flex-wrap:wrap;margin-top:18px}
.capture-help{font-size:11px;color:var(--muted);margin:12px 0 0;line-height:1.5}
.order-dialog{max-width:540px;max-height:calc(100dvh - 24px);overflow:auto;padding:26px}
.order-dialog h2{font-size:24px}
.order-dialog .document-art{transform:scale(.8);margin:0 auto 10px}
.modal-result{font-size:13px;overflow-wrap:anywhere;white-space:pre-wrap}
.payment-dialog{max-height:calc(100dvh - 24px);border-radius:18px;padding:24px}
.payment-dialog h2{font-size:22px}
.login-shell{padding:10px}
.login-story{padding:27px clamp(24px,4vw,60px);border-radius:22px}
.login-story h1{font-size:clamp(28px,3.3vw,44px)}
.login-story .login-card{padding:28px;border-radius:20px;max-width:430px}
.login-card h2{font-size:29px}
.login-brand .docuplay-logo{width:205px}
.login-card-icon{width:39px;height:39px;font-size:23px;margin-bottom:18px}
.login-card form{gap:14px}
.database-wrap{max-width:760px;padding:18px}
@media(min-width:1100px){.workspace{margin-left:246px}}
@media(max-width:1099px){
 .workspace{margin-left:0}
 .workspace main{padding:78px 20px 70px}
 .floating-controls{left:16px;right:16px;top:10px}
 .workspace main>.heading{padding-right:0}
 .service-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
 .sidebar{padding-top:48px}
}
@media(max-width:680px){
 .workspace main{padding:75px 14px 80px}
 h1{font-size:23px}
 .heading{margin-bottom:17px;align-items:flex-start}
 .heading p:not(.eyebrow){font-size:12px}
 .heading>.outline{font-size:11px;padding:7px 9px;min-height:34px}
 .panel{padding:16px;border-radius:13px}
 .form-grid{grid-template-columns:1fr;gap:14px}
 .panel input:not([type=checkbox]),.panel select,.panel textarea,.pricing-toolbar input,.pricing-toolbar select,.sale-price{font-size:16px;min-height:44px}
 .primary,.outline{min-height:42px;font-size:12px;padding:10px 12px;white-space:normal}
 .floating-controls .menu-toggle{min-height:40px}
 .profile-chip strong{max-width:130px;font-size:11px}
 .profile-chip small{font-size:9px}
 .profile-chip .avatar{width:29px;height:29px;font-size:12px}
 .intro-hero,.orders-banner{padding:19px;border-radius:15px}
 .intro-hero h2,.orders-banner h2{font-size:23px}
 .intro-hero p,.orders-banner p{font-size:12px;line-height:1.6}
 .orders-banner img{display:none}
 .metric-grid,.catalog-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .metric,.catalog-stats .card{padding:14px;min-width:0}
 .metric strong,.catalog-stats strong{font-size:22px}
 .metric small{font-size:10px}
 .intro-steps{grid-template-columns:1fr;gap:10px}
 .intro-steps article{padding:16px}
 .service-grid{grid-template-columns:minmax(0,1fr);gap:10px}
 .service.card,.service.card.selected{padding:13px;min-height:0}
 .service .service-name{font-size:13px;line-height:1.45}
 .service .icon{width:29px;height:29px;font-size:17px}
 .service .category{font-size:8px;padding:4px 6px}
 .service-top{gap:6px;margin-bottom:10px}
 .service .service-info{display:none}
 .service .price{font-size:19px}
 .service-bottom:after{width:26px;height:26px;font-size:16px}
 .service .delivery{font-size:9px}
 .wholesaler-layout .service-retail{display:block;line-height:1.5}
 .wholesaler-layout .service-retail strong{display:block;text-align:left;font-size:12px}
 .table-wrap th{padding:10px 12px}
 .table-wrap td{padding:12px;max-width:280px}
 .table-wrap td:first-child{min-width:125px}
 #ordersBody{display:grid;gap:12px;padding:12px}
 table:has(#ordersBody) thead{display:none}
 #ordersBody tr{display:grid;gap:9px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--paper)}
 #ordersBody td,#ordersBody td:first-child{display:grid;grid-template-columns:88px minmax(0,1fr);gap:8px;align-items:start;padding:0;border:0;min-width:0;max-width:none;width:auto;font-size:12px}
 #ordersBody td:before{content:attr(data-label);font-size:10px;font-weight:650;color:var(--muted);padding-top:2px}
 #ordersBody td[data-label=Folio]{font-size:13px}
 #ordersBody td .actions{min-width:0}
 .requested-data{max-width:100%}
 .requested-data-chip{font-size:11px}
 .capture-dialog{width:calc(100% - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);padding:19px 16px;border-radius:17px}
 .capture-header{margin-bottom:12px}
 .capture-header h2{font-size:21px}
 .capture-close{width:38px;height:38px}
 .capture-service{font-size:13px}
 .capture-dialog .fields{grid-template-columns:1fr;gap:13px}
 .capture-dialog .fields input,.capture-dialog .fields select,.capture-dialog .fields textarea{font-size:16px;min-height:46px}
 .capture-dialog #service-notice{max-height:120px;font-size:11px;padding:10px}
 .capture-actions{position:sticky;bottom:-19px;background:var(--paper);padding:12px 0 5px;display:grid;grid-template-columns:auto 1fr;z-index:2}
 .capture-actions .primary,.capture-actions .outline{min-height:45px}
 .capture-pricing{font-size:11px;gap:6px}
 .capture-pricing span{padding:6px 8px}
 .order-dialog{width:calc(100% - 24px);padding:22px 17px;border-radius:17px}
 .order-dialog h2{font-size:21px}
 .order-dialog .modal-actions{flex-wrap:wrap;gap:8px}
 .payment-dialog{width:calc(100% - 20px);padding:20px 16px;border-radius:17px}
 .payment-dialog h2{font-size:21px}
 .payment-ticket{height:340px}
 .manual-deposit-dialog form{gap:13px}
 .manual-deposit-dialog input:not([type=checkbox]),.manual-deposit-dialog textarea{font-size:16px}
 .pending-dock{left:14px;right:74px;bottom:16px;font-size:11px;padding:12px;line-height:1.35;max-width:none}
 .whatsapp-help{right:14px;bottom:16px;width:46px;height:46px;padding:0;justify-content:center;font-size:23px}
 .whatsapp-help span{display:none}
 .login-shell{padding:7px}
 .login-story{min-height:calc(100dvh - 14px);padding:19px 16px;gap:19px;border-radius:18px}
 .login-story h1{font-size:26px;line-height:1.12}
 .login-story-content>p:not(.login-kicker){font-size:12px}
 .login-story-top{gap:10px}
 .login-brand .docuplay-logo{width:165px;min-width:0}
 .login-story-top .theme-toggle{padding:7px 9px;font-size:10px;min-height:36px}
 .login-story-grid{gap:19px}
 .login-story .login-card{padding:21px 18px;border-radius:16px;max-width:100%}
 .login-card h2{font-size:25px}
 .login-card input{font-size:16px}
 .login-card-icon{width:35px;height:35px;font-size:21px;margin-bottom:15px}
 .login-card>.muted{margin-bottom:18px;font-size:12px}
 .login-card-foot{margin-top:19px;padding-top:13px}
 .database-wrap{margin:12px auto;padding:12px}
 .database-wrap .panel{padding:19px 16px}
 .database-wrap h1{font-size:23px}
 .permissions-list{grid-template-columns:1fr}
 .permissions-list label{min-height:48px;padding:12px;font-size:12px}
}
@media(max-width:380px){.service-grid{grid-template-columns:1fr}.service .service-name{font-size:14px}.service .delivery{font-size:10px}.service-top{margin-bottom:8px}.wholesaler-layout .service-retail{display:flex}.wholesaler-layout .service-retail strong{display:inline}.profile-chip strong{max-width:100px}.login-brand .docuplay-logo{width:145px}.capture-actions{grid-template-columns:1fr}.capture-actions .outline{order:2}}

@media(max-width:680px){#ordersBody td>small{grid-column:2}#ordersBody td>*{min-width:0}}
/* Professional finish: calm surfaces, consistent controls and visible feedback. */
:root{--motion-fast:180ms;--motion-ease:cubic-bezier(.2,.7,.2,1)}
.workspace main{animation:docuplay-page-in 260ms var(--motion-ease) both}
.card{box-shadow:0 3px 14px #0f234508}
.service.card{box-shadow:0 2px 9px #0f234505;transition:border-color var(--motion-fast),box-shadow var(--motion-fast),transform var(--motion-fast)}
.service.card:hover{transform:translateY(-2px);box-shadow:0 9px 24px #15366b12;border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
.service.card.selected{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 10%,transparent)}
.service .service-name{letter-spacing:-.15px}
.service-bottom{border-top-color:var(--line)}
.primary,.outline,.chip,.profile-chip,.sidebar nav a,.capture-close,.dialog-close{transition:background-color var(--motion-fast),border-color var(--motion-fast),box-shadow var(--motion-fast),color var(--motion-fast),filter var(--motion-fast)}
.primary:hover{filter:brightness(1.06);box-shadow:0 6px 17px #2563eb25}
.outline:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--line));background:var(--soft)}
.chip:hover{border-color:var(--accent);color:var(--accent)}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
input,select,textarea{transition:border-color var(--motion-fast),box-shadow var(--motion-fast),background-color var(--motion-fast)}
input:focus,select:focus,textarea:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 10%,transparent)}
.sidebar{transition:transform 230ms var(--motion-ease)}
.menu-backdrop:not([hidden]){animation:docuplay-backdrop-in 180ms ease-out both}
.sidebar nav a.active{color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--paper))}
.sidebar nav a:hover{color:var(--accent)}
dialog[open]{animation:docuplay-dialog-in 240ms var(--motion-ease) both;transform-origin:50% 45%}
dialog[open]::backdrop{animation:docuplay-backdrop-in 200ms ease-out both}
dialog .capture-header,dialog .modal-service,dialog .capture-service{animation:docuplay-detail-in 260ms var(--motion-ease) both}
dialog .fields{animation:docuplay-detail-in 300ms var(--motion-ease) both}
.capture-header{padding-bottom:13px;border-bottom:1px solid var(--line)}
.capture-service{margin-top:15px}
.capture-close:hover,.dialog-close:hover{background:var(--soft);color:var(--accent)}
.capture-actions .primary{font-weight:650}
#details-form[aria-busy=true] [type=submit]::before{content:'';width:13px;height:13px;border:2px solid #ffffff66;border-top-color:#fff;border-radius:50%;animation:docuplay-spin .65s linear infinite}
.success,.failure,.balance-message{animation:docuplay-detail-in 220ms var(--motion-ease) both}
.table-wrap tbody tr{transition:background-color 150ms ease}
.requested-data-chip{border-color:var(--line);background:var(--soft);color:var(--ink)}
[data-theme=dark] .card{box-shadow:0 4px 18px #030a171c}
@keyframes docuplay-page-in{from{opacity:.45;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes docuplay-dialog-in{from{opacity:0;transform:translateY(12px) scale(.975)}to{opacity:1;transform:none}}
@keyframes docuplay-backdrop-in{from{opacity:0}to{opacity:1}}
@keyframes docuplay-detail-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes docuplay-spin{to{transform:rotate(360deg)}}
@media(hover:none){.service.card:hover{transform:none;box-shadow:0 2px 9px #0f234505}.primary:hover{filter:none}}
@media(max-width:767px){
 .service-grid{grid-template-columns:minmax(0,1fr);gap:12px}
 .service.card,.service.card.selected{padding:17px;border-radius:15px}
 .service-top{margin-bottom:11px}
 .service .icon{width:31px;height:31px;font-size:18px}
 .service .category{font-size:9px;padding:4px 8px}
 .service .service-name{font-size:15px;line-height:1.45;margin-bottom:12px}
 .wholesaler-layout .service-retail{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;padding:9px 0}
 .wholesaler-layout .service-retail strong{display:block;text-align:right;font-size:14px}
 .service-bottom{flex-wrap:nowrap;gap:11px;align-items:center;padding-top:11px}
 .service .delivery{flex-basis:auto;flex:1;max-width:48%;font-size:10px;line-height:1.5}
 .service .price{font-size:21px;white-space:nowrap}
 .service-bottom:after{width:29px;height:29px;flex-shrink:0}
 .capture-dialog{border-radius:18px}
 .capture-dialog .capture-header h2{font-size:21px}
 .capture-pricing span{border-radius:8px}
}
@media(prefers-reduced-motion:reduce){
 .workspace main,dialog[open],dialog[open]::backdrop,dialog .capture-header,dialog .modal-service,dialog .capture-service,dialog .fields,.success,.failure,.balance-message,.menu-backdrop:not([hidden]){animation:none!important}
 *,*::before,*::after{transition-duration:.01ms!important}
}
