/* Presentation layer only. All mutations use the existing store and permission checks. */
:root,:root[data-theme],:root[data-accent]{--theme-start:#20d8b9;--theme-end:#13a6df;--theme-accent:#078882;--theme-button-ink:#fff;--brand:var(--theme-accent);--brand-strong:var(--theme-accent);--brand-alt:var(--theme-start);--brand-contrast:var(--theme-button-ink);--background:#f3fafa;--foreground:#193c50;--card:#fff;--card-foreground:#193c50;--popover:#fff;--popover-foreground:#193c50;--primary:var(--theme-accent);--primary-foreground:var(--theme-button-ink);--secondary:#edf7f8;--secondary-foreground:#224d60;--muted:#edf5f7;--muted-foreground:#627c89;--accent:#e4f4f3;--accent-foreground:#193c50;--destructive:#b53249;--border:#d8e8eb;--input:#cddfe3;--ring:var(--theme-accent);--py-ink:#193c50;--py-bg:#f4fafb;--py-card:#fff;--py-border:#d8e8eb;--py-accent:var(--theme-accent)}
body{background:linear-gradient(135deg,var(--theme-end),var(--theme-start)) fixed;color:var(--foreground)}button,input,select,textarea{font-family:inherit}button,a,summary,input,select,textarea{outline-offset:3px}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--theme-accent)}[hidden]{display:none!important}summary{cursor:pointer}button{cursor:pointer}input[type=checkbox]{accent-color:var(--theme-accent)}
.case-app{background:transparent!important;min-height:100dvh;padding:20px 20px 20px 22px}.main-shell{margin-right:244px!important;background:#f3fafbea;border:1px solid #ffffff99;border-radius:24px;min-height:calc(100dvh - 110px);overflow:clip}.workspace{padding:24px 27px 60px!important}.main-shell .topbar{background:transparent!important;margin:0 25px;padding:16px 0!important;border-color:#d5e9e9;position:relative;top:auto;flex-wrap:wrap;min-height:78px}.global-search{background:#fff!important;border:1px solid var(--border)!important;max-width:600px}.global-search input{color:var(--foreground)!important}.topbar .new-case-button{display:none}.notification-button,.menu-button{color:var(--theme-accent)!important}
.sidebar,:root[data-theme=light] .sidebar{inset:65px 15px 15px auto;width:229px;background:transparent!important;border:0!important;box-shadow:none;color:#123b4d;overflow-y:auto}.sidebar .brand{border:0;padding:12px 8px 26px;height:auto;flex-shrink:0}.brand-mark{background:#ffffffdb!important;color:#0e5865!important;box-shadow:none!important}.brand strong{font-size:22px}.brand span{font-size:10px;color:#123b4d}.sidebar nav{padding:12px 5px;gap:9px}.sidebar nav button,.modern-admin{border:0!important;color:#123b4d!important;font-size:14px;font-weight:600;min-height:49px;flex-shrink:0;padding:12px 16px!important;display:flex;align-items:center;gap:12px;text-decoration:none;border-radius:13px}.sidebar nav button.active{background:#fff!important;color:var(--theme-accent)!important;box-shadow:0 6px 16px #15576816!important}.sidebar nav button:hover,.modern-admin:hover{background:#ffffff77!important}.sidebar nav button span{white-space:normal}.sidebar nav em{background:#ffffff80;color:#29576b}.sidebar-foot{background:#ffffff66!important;color:#19485a!important;border:0!important;border-radius:14px;margin:24px 6px 0}.sidebar-foot span{color:#396474!important;font-size:10px}.modern-tools{border-top:1px solid #ffffff70;padding-top:14px;margin-top:10px}.modern-tools summary{font-size:12px;padding:8px 16px;color:#224d60}.modern-tools button{width:100%}
.py-account-strip{background:#ffffffdd!important;color:#193c50!important;border:0!important;box-shadow:none!important;min-height:48px;position:relative!important;z-index:45!important;gap:12px;padding:9px 25px!important;flex-wrap:wrap}.py-account-strip a,.py-account-strip button,.py-account-strip select{background:#fff!important;color:#265b6d!important;border:1px solid #d5e8ea!important;border-radius:8px!important;padding:6px 10px!important;font-size:11px}.py-account-strip nav{flex-wrap:wrap}.py-account-tools{position:relative}.py-account-tools summary{font-size:12px}.py-account-tools[open]>div{position:absolute;left:0;top:28px;min-width:240px;padding:12px;background:white;box-shadow:0 10px 40px #18364422;border:1px solid var(--border);border-radius:12px;display:flex;flex-direction:column;gap:9px;z-index:50}
.page-head{margin-bottom:23px!important;align-items:center;gap:18px}.page-head h1{font-size:27px!important;color:#193c50}.page-head p{color:#627c89;font-size:12px!important;margin-top:9px}.page-head>div>span{color:#627c89!important}.page-actions{display:flex;gap:10px;flex-wrap:wrap}.page-actions button,.modern-primary,.modern-cases button,.modern-event button,.modern-schedule button,.modern-theme button,.modern-column-choices button{font:inherit;border:1px solid var(--border);border-radius:10px;padding:10px 14px;background:white;color:#265b6d;line-height:1.6}.modern-primary{background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:var(--theme-button-ink)!important;box-shadow:0 5px 15px #127b781a}.modern-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin:0 0 24px}.modern-stats article{background:#fff;border:1px solid #e1eded;border-radius:17px;padding:21px 23px;box-shadow:0 4px 15px #19495905}.modern-stats span{font-size:12px;color:#688591;display:block}.modern-stats strong{font-size:30px;color:#193c50;display:block;margin-top:12px}.panel,.py-panel{background:#fff!important;border-color:var(--border)!important;color:var(--foreground);box-shadow:0 7px 22px #17495905!important}.py-panel h2{font-size:20px;margin:0 0 15px}.py-panel p{line-height:1.9}.modern-dashboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.modern-dashboard .py-panel{margin-top:0}.modern-event{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:17px 0;border-bottom:1px solid #e8f0f2;flex-wrap:wrap}.modern-event b,.modern-event small{display:block;overflow-wrap:anywhere}.modern-event small{font-size:11px;color:#718996;margin-top:8px}.modern-event button{font-size:12px;white-space:nowrap}.modern-empty{padding:25px;color:#617d8a}.modern-table-tools{padding:19px 23px;margin:0!important;align-items:end}.modern-table-tools>details{position:relative;font-size:12px;padding:12px 5px}.modern-column-choices{position:absolute;top:38px;right:0;min-width:240px;background:#fff;box-shadow:0 8px 30px #193c5025;border:1px solid var(--border);border-radius:12px;padding:15px;z-index:6;display:flex;flex-direction:column;gap:12px}.modern-column-choices label{display:flex;gap:12px}.modern-bulk{margin:0 23px 15px;font-size:12px;color:#4c7283}.py-bulk-tools{background:#f2f9fa!important;border-color:var(--border)!important;color:var(--foreground)}.py-bulk-tools button{background:white!important;color:#31566b!important;border-color:#c7dce2!important}.py-bulk-tools .py-bulk-danger{color:#a22d46!important}.modern-table-scroll{overflow:auto!important;max-height:65vh;min-height:220px;resize:vertical}.modern-table{table-layout:fixed;border-collapse:separate!important;border-spacing:0;min-width:0!important}.modern-table thead th{position:sticky;top:0;z-index:2;background:#f2f8f9!important;color:#647f8c;padding:15px 10px!important;white-space:normal}.modern-table th>button{padding:0;background:transparent;border:0;color:inherit;font-size:12px;max-width:calc(100% - 12px);text-align:right}.column-resizer{position:absolute;left:0;top:0;bottom:0;width:10px;cursor:col-resize;touch-action:none;border-left:2px solid #c9dedf}.column-resizer:hover,.column-resizer:focus{background:#0c948433}.modern-resizing{cursor:col-resize;user-select:none}.modern-table td{padding:21px 10px!important;border-bottom:1px solid #e9f0f2;color:#284b60;overflow-wrap:anywhere;white-space:normal!important}.modern-table td .table-title{display:block;white-space:normal;text-align:right;font-size:17px;font-weight:700;color:var(--theme-accent);border:0;padding:0;overflow-wrap:anywhere;max-width:100%;background:transparent}.modern-table tr:hover td{background:#f7fbfc}.modern-table .modern-case-number{direction:ltr;text-align:right;font-variant-numeric:tabular-nums;word-break:break-all}.modern-status{display:inline-block;border-radius:20px;background:#e6f5f1;color:#186956;padding:6px 10px;font-size:11px}.modern-paging{padding:12px 23px;margin:0!important}.modern-paging>span:first-child{margin-left:auto}.modern-row-menu{position:relative}.modern-row-menu summary{font-size:25px;list-style:none;padding:5px}.modern-row-menu>div{display:flex;flex-direction:column;min-width:170px;gap:5px}.modern-row-menu[open]{min-width:160px;background:white;border:1px solid var(--border);border-radius:9px;position:relative;z-index:3;margin-right:-120px;padding:6px}.modern-row-menu button{font-size:11px;text-align:right}.modern-danger{color:#a52a43!important}
.case-editor{--editor-size:100vw;--field-width:330px;position:fixed!important;inset:0 auto 0 50%!important;transform:translateX(-50%)!important;width:var(--editor-size)!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;min-width:min(720px,100vw)!important;border-radius:0!important;background:#f5fafb!important;resize:both!important;overflow:hidden!important;border:1px solid var(--border)!important;z-index:55!important}.editor-header{height:auto!important;min-height:80px;flex:0 0 auto!important;flex-wrap:wrap;padding:14px 22px!important;background:#fff;gap:15px!important}.editor-title{flex:1;min-width:230px!important}.editor-title>div{min-width:0;flex:1}.editor-title h2,.editor-title p{white-space:normal!important;text-overflow:clip!important;overflow:visible!important;overflow-wrap:anywhere;max-width:none!important}.editor-title h2{font-size:17px!important;line-height:1.8}.editor-title p{line-height:1.9;font-size:12px!important}.editor-actions{flex-wrap:wrap}.editor-actions button{font-size:12px}.modern-case-summary{display:flex;flex:0 0 auto;align-items:center;gap:25px;padding:13px 23px;background:#eaf6f6;flex-wrap:wrap;border-bottom:1px solid var(--border)}.modern-case-summary>div{min-width:170px;flex:1}.modern-case-summary span{font-size:11px;color:#61838f;display:block;margin-bottom:7px}.modern-case-summary b{font-size:13px;white-space:normal;overflow-wrap:anywhere;display:block;text-align:right}.modern-case-summary details{font-size:11px;max-width:220px}.modern-case-summary details[open]{width:220px}.modern-case-summary .py-field{margin:8px 0}.modern-case-summary input{padding:0}.py-stage-panel{flex-shrink:0;background:white!important;padding:10px 20px!important;border-color:var(--border)!important}.py-stage-tabs{display:flex;gap:9px;overflow-x:auto;flex-wrap:nowrap!important}.py-stage-tabs button{white-space:nowrap;flex-shrink:0;padding:10px 17px;background:#f3f8fa!important;color:#4a6d7b!important;border:1px solid var(--border)!important;border-radius:11px!important}.py-stage-tabs button[aria-selected=true]{background:var(--theme-accent)!important;color:var(--theme-button-ink)!important;border-color:var(--theme-accent)!important}.py-stage-panel>small{font-size:10px;color:#6b8592}.py-stage-panel details{font-size:11px;margin-top:7px}.py-stage-panel details[open]{max-height:190px;overflow:auto}.case-editor>.py-followup{margin:5px 20px!important;padding:8px 14px!important;font-size:11px;background:#fff}.editor-tabs{display:flex!important;flex-direction:column!important;overflow:hidden;flex:1;min-height:0!important}.editor-tabs>.py-followup{margin:5px 20px;padding:8px 14px;max-height:200px!important}.editor-tablist{display:flex!important;flex-direction:row!important;flex-shrink:0!important;overflow-x:auto!important;height:auto!important;min-height:48px;padding:7px 18px!important;border:0!important;border-bottom:1px solid var(--border)!important;gap:7px!important;background:#fff!important;justify-content:flex-start!important}.editor-tablist button{width:auto!important;flex-shrink:0!important;white-space:nowrap;height:38px!important;min-height:38px!important;color:#577685!important;border-radius:8px!important;padding:7px 12px!important}.editor-tablist button[data-state=active]{background:#e3f3f1!important;color:var(--theme-accent)!important}.editor-tablist em{background:#e1efef;color:#3e6b79}.editor-body{flex:1;min-height:0!important;height:auto!important;padding:0 25px 35px!important}.form-grid{grid-template-columns:repeat(auto-fit,minmax(min(var(--field-width),100%),1fr))!important}.field-wide{grid-column:1/-1}.field>span,.form-section>header p{color:#577481!important}.field input,.field textarea,.app-select,.editor-body input,.editor-body textarea{background:#fff!important;color:#193c50!important;border-color:#cfdee3!important}.field{overflow:visible!important}.field textarea{resize:both!important;max-width:100%;min-width:0}.date-input-wrap{min-width:0}.case-editor .case-avatar{background:#e0f3ef!important;color:var(--theme-accent)!important}.case-missing-notice{background:#fff8e7!important;border-color:#efe0b6!important;color:#82612c!important}.py-followup,.py-compare{background:#fff!important;border-color:var(--border)!important}.py-followup input,.py-followup select{background:#f7fbfc!important}.editor-doc-list>article,.hearing-card,.action-card,.reminder-card{background:#fff!important;border-color:var(--border)!important;color:#193c50!important}.doc-icon{background:#e5f4f4!important;color:var(--theme-accent)!important}.modern-media-icon{font-weight:bold;font-size:20px}.modern-media-icon.pdf{font-size:12px}.modern-media-icon.audio{color:#8a53b0}.modern-media-icon.video{color:#3281b6}.modern-document-filter{padding:10px;background:#edf6f7;border-radius:12px}.py-preview{background:#fff!important}.py-preview video{max-width:100%;max-height:60vh}.py-preview audio{width:min(550px,100%)}.py-upload-list,.py-upload-status{color:#244f63!important}.py-upload-track{background:#d7e9eb!important}.py-upload-track>span{background:var(--theme-accent)!important}.py-upload-caption{color:#31596a!important}.py-upload-controls button,.py-upload-bulk button{background:white!important;border-color:var(--border)!important;color:#275b70!important}
.modern-theme .theme-sample{min-height:120px;border-radius:16px;padding:22px;display:flex;align-items:center;justify-content:space-between;color:#123044;margin:18px 0}.theme-sample>span{font-size:22px;font-weight:bold}.theme-sample>div{background:white;padding:15px;border-radius:12px;display:flex;align-items:center;gap:20px}.theme-sample b{padding:10px;border-radius:8px;font-size:12px}.color-control{display:flex;align-items:center;gap:12px}.color-control input[type=color]{height:48px;width:85px;padding:4px;cursor:pointer}.color-control code{direction:ltr;font-size:13px}.modern-comparison table{min-width:500px}.modern-comparison td{white-space:pre-wrap;vertical-align:top;max-width:300px}.modern-comparison .diff-new td:last-child,.comparison-legend .diff-new{background:#e5f6ee;color:#21694a}.modern-comparison .diff-changed td:last-child,.comparison-legend .diff-changed{background:#fff2d7;color:#76500e}.comparison-legend{display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:12px}.comparison-legend span{padding:7px 12px;border-radius:8px}.py-compare{max-height:360px!important;resize:vertical}.modern-comparison .py-table-scroll{max-height:250px}.py-warning{color:#885514}.py-request,.py-backup-dialog,.py-draft-close>section{background:#fff!important;color:#193c50!important;border-color:var(--border)!important}.py-request input,.py-request select,.py-request textarea,.py-request button,.py-draft-close button{background:#f1f8f9!important;color:#193c50!important;border-color:var(--border)!important}.py-draft-close{background:#16475780}.py-login{background:linear-gradient(135deg,var(--theme-end),var(--theme-start))!important;color:#193c50}.py-login-card{background:white!important;border:0!important;color:#193c50!important}.py-login-card button{background:var(--theme-accent)!important;color:var(--theme-button-ink)!important}.py-login-card input{background:#f5fafb!important;color:#193c50!important}.py-save-status{background:#fff!important;border-color:#cee3e6!important;color:#356274!important}.backup-warning{background:#fff7df!important;border-color:#efdfb6!important;color:#795f30!important}.data-table td em,.empty-state p{color:#728b97!important}
@media(max-width:1100px){.main-shell{margin-right:218px!important}.sidebar{width:209px}.modern-dashboard{grid-template-columns:1fr}.workspace{padding:20px 18px 60px!important}.modern-stats{gap:10px}.modern-stats article{padding:15px}.py-account-strip{padding:9px 14px!important}.editor-actions{gap:5px}.editor-header{padding:10px 15px!important}}
@media(max-width:800px){.case-app{padding:10px}.main-shell{margin-right:0!important;min-height:calc(100dvh - 70px);border-radius:18px}.sidebar{background:linear-gradient(135deg,var(--theme-end),var(--theme-start))!important;width:250px;inset:0 0 0 auto;z-index:60;transform:translateX(110%);transition:transform .2s;padding:20px 10px}.sidebar.open{transform:translateX(0)}.mobile-close,.menu-button{display:flex!important}.main-shell .topbar{margin:0 15px}.global-search{max-width:none;flex:1;min-width:100px}.py-account-strip>strong{font-size:11px}.py-account-strip select{max-width:155px}.modern-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.page-head{align-items:flex-start;flex-direction:column}.page-head h1{font-size:23px!important}.modern-table{width:100%!important}.modern-table colgroup,.modern-table thead{display:none}.modern-table tbody{display:grid;padding:12px;gap:14px}.modern-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));background:#fff;border:1px solid #d2e5e7;border-radius:14px;padding:10px;box-shadow:0 4px 10px #15395008}.modern-table td{display:block;padding:10px!important;border:0!important;overflow-wrap:anywhere;min-width:0}.modern-table td:before{content:attr(data-label);display:block;font-size:10px;color:#718c99;margin-bottom:8px}.modern-table td.modern-archive{grid-column:2;grid-row:1}.modern-table td:last-child{grid-column:1/-1}.modern-table-scroll{max-height:75vh;resize:vertical}.modern-table-tools{padding:15px;gap:10px}.modern-table-tools .py-field{max-width:45%}.modern-table-tools select{max-width:100%}.modern-column-choices{right:auto;left:0}.modern-row-menu[open]{margin-right:0}.modern-row-menu>div{flex-direction:row;flex-wrap:wrap}.modern-paging{padding:12px;font-size:11px}.modern-case-summary{gap:10px;padding:10px 15px;max-height:155px;overflow:auto}.modern-case-summary>div{min-width:130px}.modern-case-summary b{font-size:11px}.case-editor{min-width:100vw!important;max-width:100vw!important;width:100vw!important;resize:none!important}.editor-header{gap:8px!important;min-height:95px}.editor-title{min-width:150px!important}.editor-title h2{font-size:14px!important}.editor-title p{font-size:10px!important}.editor-actions{width:100%;justify-content:flex-start;overflow:auto;flex-wrap:nowrap}.editor-actions button{white-space:nowrap;font-size:10px;height:32px}.editor-actions .editor-close{margin-right:auto}.case-avatar.large{width:32px;height:32px;font-size:16px}.py-stage-panel{padding:8px 12px!important}.py-stage-panel>small{display:none}.py-stage-tabs button{font-size:11px;padding:8px 12px}.editor-tablist{padding:5px 10px!important;min-height:41px}.editor-tablist button{font-size:11px!important;height:32px!important;min-height:32px!important}.editor-tabs>.py-followup{margin:4px 10px!important}.case-editor>.py-followup{margin:4px 10px!important}.editor-body{padding:0 14px 25px!important}.form-section>header{min-height:60px}.py-preview{width:96vw;height:92vh;min-width:0}.theme-sample{flex-wrap:wrap;gap:15px}.modern-theme .py-grid{grid-template-columns:1fr}.modern-event{gap:9px}.py-save-status{max-width:95vw;font-size:10px}.modern-document-filter select{max-width:150px}}
@media print{body,.case-app{background:white!important}.sidebar,.py-account-strip,.modern-tools,.column-resizer,.py-save-status{display:none!important}.main-shell{margin:0!important}.case-editor{position:static!important;transform:none!important;width:100%!important;height:auto!important;max-height:none!important}.editor-body{overflow:visible!important}}
.case-editor{translate:none!important;animation:none!important}
.modern-nav button.active:hover{background:#fff!important}
.case-editor .editor-tabs{display:flex!important;flex-direction:column!important;grid-template-areas:none!important}
.case-editor .editor-tablist{width:100%!important;height:auto!important;min-height:48px!important;flex:0 0 auto!important;justify-content:flex-start!important;align-items:center!important}
.case-editor .editor-body{height:auto!important;flex:1 1 0;min-height:0!important}
.modern-table td{font-size:calc(var(--py-font) - 1px)}
.py-admin p{color:#627c89}.py-admin{background:linear-gradient(135deg,var(--theme-end),var(--theme-start)) fixed!important}
.case-app:not(:has(.modern-stats)) .topbar .new-case-button{display:inline-flex}
.py-document-overlay{pointer-events:auto!important;z-index:2147483100!important}
.case-editor>.py-document-overlay .py-preview{max-width:100%;width:95%;min-width:0}
@media(max-width:800px){.case-editor .editor-tablist{min-height:41px!important}.case-editor .editor-header{max-height:160px;overflow:auto}.case-editor .editor-title{flex:1 1 auto}}
