@font-face{font-family:Vazirmatn;src:url('/fonts/vazirmatn-v33.003.woff2') format('woff2');font-weight:100 900;font-display:swap}
:root{color-scheme:dark;--bg:#121212;--sidebar:#171717;--panel:#1b1b1b;--panel-up:#252525;--line:#353535;--text:#f2f2f2;--muted:#b6b6b6;--dim:#9c9c9c;--green:#a8dba9;--green-text:#b4dcb5;--focus:#a8dba9;--offline:#a0a0a0;--radius:18px;--sidebar-w:228px;font:400 16px/1.62 Vazirmatn,Tahoma,Arial,sans-serif}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);min-width:320px}
button,input,textarea,select{font:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{cursor:wait;opacity:.55}
a{color:inherit;text-decoration:none}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
:where(h1,h2,h3,p){margin:0}
[hidden]{display:none!important}
.icon{width:20px;height:20px;display:inline-block;flex:none;vertical-align:middle}
.skip-link{position:fixed;z-index:10;top:8px;right:12px;background:var(--green);color:#18221a;padding:.5rem 1rem;border-radius:10px;transform:translateY(-180%)}
.skip-link:focus{transform:none}
.shell{min-height:100vh;display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr)}
.sidebar{display:flex;flex-direction:column;position:sticky;top:0;height:100dvh;overflow-y:auto;padding:25px 16px 16px;background:var(--sidebar);border-inline-end:1px solid #2c2c2c;z-index:3}
.logo{display:flex;width:fit-content;flex-direction:column;align-items:flex-start;gap:6px;padding:0 8px;color:var(--text)}
.logo img{display:block;width:96px;height:auto}
.logo small{font-size:.79rem;line-height:1.22;color:var(--muted)}
.side-nav{display:grid;gap:5px;margin-top:42px}
.nav-title{font-size:.78rem;color:var(--dim);margin:0 11px 5px}
.nav-item{display:flex;align-items:center;gap:11px;padding:10px 12px;min-height:45px;border-radius:10px;color:#b9b9b9;position:relative;font-size:.93rem;white-space:nowrap}
.nav-item:hover,.account:hover,.icon-btn:hover{background:#282828;color:var(--text)}
.nav-item[aria-current=page]{background:#252525;color:var(--text);font-weight:600}
.nav-item[aria-current=page]::before{content:"";position:absolute;inset-inline-start:0;top:12px;bottom:12px;width:2px;background:#a8dba9;border-radius:4px}
.sidebar-footer{margin-top:auto;padding-block-start:16px;display:grid;gap:15px}
.connection{display:flex;align-items:center;gap:8px;padding:0 9px;color:var(--muted);font-size:.81rem}
.connection-dot{width:7px;height:7px;flex:none;border-radius:50%;background:#a8dba9}
.connection-dot.offline{background:var(--offline)}
.account{width:100%;padding:9px;display:flex;align-items:center;gap:8px;text-align:start;border:1px solid var(--line);border-radius:12px;background:#222222;color:var(--text)}
.avatar{display:grid;place-items:center;background:#303030;color:#ededed;width:33px;height:33px;border-radius:10px;flex:none;font-weight:700}
.account strong{font-weight:600;display:block;font-size:.85rem;line-height:1.3;overflow-wrap:anywhere}
.account small{font-size:.73rem;color:var(--muted);display:block;line-height:1.5}
.account>.icon{margin-inline-start:auto;width:17px;height:17px;color:var(--muted)}
.workspace{min-width:0}
.topbar{height:69px;border-bottom:1px solid #2c2c2c;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 clamp(20px,3.2vw,48px)}
.topbar-path{display:flex;align-items:center;gap:9px;color:var(--muted);font-size:.87rem;min-width:0}
.topbar-path .icon{width:16px;height:16px;color:#9a9a9a}
.topbar-path strong{color:var(--text);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-actions{display:flex;align-items:center;gap:9px}
.demo-label{color:#c2c2c2;border:1px solid #393939;font-size:.75rem;padding:4px 10px;border-radius:20px;white-space:nowrap}
.icon-btn{display:inline-grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);color:var(--muted);background:var(--panel);border-radius:10px}
.icon-btn .icon{width:17px;height:17px}
.mobile-brand,.mobile-nav{display:none}
.content{max-width:1550px;margin:0 auto;padding:28px clamp(20px,3.2vw,48px) 42px}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:8px 15px;border-radius:10px;border:1px solid #404040;background:#242424;color:var(--text);font-weight:600;font-size:.9rem;line-height:1.45;white-space:nowrap}
.btn .icon{width:17px;height:17px}
.btn:hover{background:#303030}
.btn.primary{background:var(--green);color:#172219;border-color:#a8dba9;box-shadow:0 3px 11px #00000035}
.btn.primary:hover{background:#bbe8bc}
.btn.ghost{background:transparent}
.btn.danger{color:#f1f1f1}

.section-head{display:flex;justify-content:space-between;align-items:end;gap:14px;margin:28px 0 13px}
.section-head h2,.page-head h1{font-size:1.4rem;font-weight:700}
.section-head p,.page-head p{font-size:.85rem;color:var(--muted)}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.metric{border:1px solid var(--line);background:var(--panel);color:var(--text);text-align:start;padding:12px 15px 11px;border-radius:14px;min-height:91px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;column-gap:6px}
.metric:hover{border-color:#626262;background:#252525}
.metric .badge-icon{grid-column:2;grid-row:1/3}
.metric strong{font-size:1.65rem;line-height:1.2;font-weight:700}
.metric span:not(.badge-icon){font-size:.82rem;color:#c7c7c7}
.badge-icon{width:38px;height:38px;border-radius:11px;background:#303030;color:#d8d8d8;display:grid;place-items:center;flex:none}
.badge-icon .icon{width:19px;height:19px}
[data-status=draft]{--record-accent:#90aadb;--record-surface:#1f242c;--record-hover:#272f3a;--record-pill:#303e53;--record-ink:#d1dfff}
[data-status=pending]{--record-accent:#d8a963;--record-surface:#2b251d;--record-hover:#362d20;--record-pill:#493821;--record-ink:#f6d49d}
[data-status=registered]{--record-accent:#94c5a5;--record-surface:#212b24;--record-hover:#28362d;--record-pill:#314839;--record-ink:#c1e8cf}
.metric[data-status] .badge-icon{background:var(--record-pill,#303030);color:var(--record-ink,#d8d8d8)}
.metric[data-status=all][aria-pressed=true] .badge-icon{color:var(--green-text)}
.metric[data-status][aria-pressed=true]{border-color:var(--record-accent,#91b792);background:var(--record-surface,#252525)}
.records{margin-top:27px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.records.standalone{margin-top:0}
.records-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:17px 19px 14px}
.records-header h2{font-size:1.12rem;font-weight:700}
.records-header p{font-size:.81rem;color:var(--muted);margin-top:2px}
.filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.searchbox{display:flex;align-items:center;gap:7px;background:#171717;border:1px solid #383838;border-radius:9px;min-height:39px;padding:0 9px;color:var(--muted);max-width:100%}
.searchbox input{width:184px;min-width:0;border:0;outline:0!important;color:var(--text);background:none;font-size:.87rem}
.searchbox:focus-within{border-color:#a8dba9}
.searchbox .icon{width:17px;height:17px}
.searchbox input::placeholder{color:#a6a6a6}
.select{position:relative;display:inline-flex;align-items:center;min-height:39px}
.select select{appearance:none;background:#242424;color:#e5e5e5;border:1px solid #404040;border-radius:9px;min-height:39px;padding:6px 10px 6px 30px;min-width:102px;font-size:.86rem}
.select .icon{position:absolute;pointer-events:none;inset-inline-end:9px;width:15px;height:15px;color:var(--muted)}
.table-wrap{width:100%}
table{border-collapse:collapse;width:100%;text-align:start}
th{font-weight:600;color:#bdbdbd;white-space:nowrap;text-align:start;background:#242424;font-size:.79rem;padding:9px 10px}
td{border-top:1px solid #303030;padding:11px 10px;white-space:nowrap;font-size:.87rem;color:#d8d8d8}
th:first-child,td:first-child{padding-inline-start:19px}
th:last-child,td:last-child{padding-inline-end:17px}
.records-title-group{flex:none}
.record-row{background:var(--record-surface,var(--panel))}
.record-row:is(:hover,:focus-within){background:var(--record-hover,var(--panel-up))}
.record-row>td:first-child{border-inline-start:3px solid var(--record-accent,var(--line))}
.record-mobile-date{display:none}
.action-column{width:102px}
.action-column .row-open{margin-inline:auto}
@media(min-width:641px){
  .records table{table-layout:fixed}
  .records th.customer-column{width:17%}
  .records th.type-column{width:15%}
  .records th.status-column{width:116px}
  .records th.date-column{width:132px}
  .record-row :is(.customer-column,.type-column){overflow:hidden;text-overflow:ellipsis}
}
@media(min-width:641px) and (max-width:850px){
  .records th.status-column{width:104px}
  .records th.date-column{width:88px}
  .records :is(th,td).type-column{display:none}
}
@media(min-width:641px) and (max-width:760px){
  .records :is(th,td).customer-column{display:none}
}
.contract-cell{display:flex;align-items:center;gap:9px;white-space:normal;color:var(--text);min-width:0}
.contract-cell .badge-icon{width:32px;height:32px;border-radius:8px}
.contract-cell .badge-icon.sale{color:#d6d6d6;background:#303030}
.contract-cell strong,.contract-cell small{display:block}
.contract-cell strong{font-weight:600;line-height:1.38}
.contract-cell small{color:var(--muted);font-size:.73rem;margin-top:3px}
.status{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:22px;font-size:.76rem;color:#c7c7c7;background:#292929}
.status::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}
.status[data-status]{background:var(--record-pill,#292929);color:var(--record-ink,#c7c7c7)}
.status.registered:not([data-status]){background:#383838;color:#f1f1f1}
.status.draft::before{background:transparent;border:1px solid currentColor}
.status.pending::before{border-radius:1px;transform:rotate(45deg)}
.row-open{display:grid;place-items:center;width:31px;height:31px;border:1px solid var(--line);border-radius:8px;color:var(--muted)}
.row-open:hover{color:var(--green);border-color:#858585}
.row-open .icon{width:15px;height:15px}
.empty{text-align:center;color:var(--muted);padding:35px 18px}
.empty .icon{width:25px;height:25px;display:block;margin:0 auto 8px;color:var(--green-text)}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.page-head h1{font-size:clamp(1.55rem,3vw,2.1rem)}
.page-head .heading-copy{min-width:0}
.page-head-actions,.inline-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.template-card{padding:24px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);display:grid;align-content:start;gap:12px}
.template-card h2{font-size:1.32rem}
.template-card p{color:var(--muted);max-width:38ch}
.template-card .btn{justify-self:start;margin-top:5px}
.dialog{width:min(620px,calc(100% - 28px));max-height:calc(100dvh - 30px);padding:0;color:var(--text);background:var(--panel);border:1px solid #4b4b4b;border-radius:20px;box-shadow:0 24px 90px #000000ab;overflow:auto}
.dialog::backdrop{background:#000000ac;backdrop-filter:blur(5px)}
.dialog-inner{padding:23px}
.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px}
.dialog-head h2{font-size:1.25rem}
.dialog .template-card{padding:15px;border-radius:12px}
.dialog .template-card p{font-size:.87rem}
.edit-mode-options{display:grid;gap:9px}
.edit-mode-choice{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:73px;padding:11px 13px;border:1px solid var(--line);border-radius:12px;background:#202020;color:var(--text);text-align:start}
.edit-mode-choice:hover,.edit-mode-choice:focus-visible{border-color:var(--green);background:#242824}
.edit-mode-choice>.icon{width:17px;height:17px;color:var(--muted)}
.edit-mode-copy{display:grid;gap:3px}
.edit-mode-copy strong{font-size:1rem}
.edit-mode-copy small{font-size:.83rem;line-height:1.7;color:var(--muted)}
.edit-mode-footer{display:flex;justify-content:flex-end;margin-top:12px}
.editor-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);align-items:start;gap:16px}
.editor-main,.editor-rail{display:grid;gap:14px;min-width:0}
.editor-panel{border:1px solid var(--line);border-radius:16px;background:var(--panel);overflow:hidden}
.panel-heading{padding:14px 16px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line)}
.panel-heading h2{font-size:1.02rem}
.panel-body{padding:15px 16px}
.panel-body>p{color:var(--muted);font-size:.87rem}
.form-tabs{display:flex;align-items:center;gap:5px;padding:8px;border-bottom:1px solid var(--line)}
.form-tabs button{padding:8px 12px;background:transparent;color:var(--muted);border:1px solid transparent;border-radius:8px;font-weight:600;font-size:.89rem}
.form-tabs button[aria-pressed=true]{color:var(--green-text);background:#2c2c2c;border-color:#404040}
.form-tabs .editor-preview-jump{display:none;margin-inline-start:auto}
@media(max-width:850px){.form-tabs .editor-preview-jump{display:block}}
.form-group{margin:0;border:0;padding:0;min-width:0}
.form-group+.form-group{margin-top:17px;padding-top:14px;border-top:1px solid var(--line)}
.form-group legend{font-weight:700;font-size:.95rem;padding:0;margin-bottom:9px}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.field{display:grid;gap:4px;color:#d6d6d6;font-size:.85rem;min-width:0}
.field.wide{grid-column:1/-1}
.field input,.field textarea,.field select{min-width:0;width:100%;padding:8px 9px;color:var(--text);background:#151515;border:1px solid #424242;border-radius:8px;font-size:1rem}
.field input,.field select{min-height:41px}
.field textarea{min-height:82px;resize:vertical}
.field input::placeholder,.field textarea::placeholder{color:#a8a8a8}
.editor-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 16px;border-top:1px solid var(--line)}
.hint{margin-top:8px;color:var(--muted);font-size:.8rem}
.form-error{border-inline-start:2px solid var(--dim);padding-inline-start:8px;margin:3px 0;color:#eee;font-size:.86rem}
.paper-preview{background:#fff;color:#1a1a1a;margin:0;border-radius:9px;padding:16px 17px;max-height:440px;overflow:auto;overflow-wrap:anywhere;font-size:.88rem;line-height:1.8}
.paper-preview h3{font-size:1.03rem;color:#191919;margin-bottom:7px}
.paper-preview h4{font-size:inherit;margin:0 0 3px}
.paper-preview section+section{margin-top:10px}
.file-rows,.version-rows{display:grid;gap:0;margin:0;padding:0;list-style:none}
.file-rows li,.version-rows li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--line);font-size:.84rem;overflow-wrap:anywhere}
.file-rows li:last-child,.version-rows li:last-child{border-bottom:0}
.file-rows .btn,.version-rows .btn{min-height:33px;padding:5px 8px;font-size:.77rem}
.upload-form{display:grid;gap:9px;margin-top:9px}
.upload-form input{font-size:.84rem;max-width:100%;color:var(--muted)}
.upload-form select{min-width:0;width:100%}
.upload-form .btn{justify-self:start}
.version-rows small{color:var(--muted)}
.notice{position:fixed;z-index:8;bottom:22px;inset-inline-end:24px;display:flex;gap:8px;align-items:center;padding:11px 15px;border:1px solid #6a786b;border-radius:12px;color:#efefef;background:#262626;box-shadow:0 9px 34px #00000077;max-width:min(450px,calc(100% - 30px))}
.notice:not(.error)>.icon{color:var(--green-text)}
.notice.error{background:#303030;border-color:#989898;color:#fff}
.login-wrap{min-height:100dvh;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at 35% 25%,#292929,transparent 52%),var(--bg)}
.login-card{width:min(100%,430px);padding:29px;border:1px solid #454545;border-radius:23px;background:#202020;box-shadow:0 28px 75px #0000006d}
.login-card .logo{padding:0;margin-bottom:24px}
.login-card h1{font-size:1.7rem}
.login-card p{color:var(--muted);font-size:.91rem;margin:4px 0 16px}
.login-card form{display:grid;gap:9px}
.login-card .btn{width:100%}
.login-card .form-error{color:#f3f3f3;margin:0}
.initial-loading{margin:22vh auto;color:var(--muted);text-align:center}
@media(max-width:1100px){:root{--sidebar-w:190px}.searchbox input{width:140px}.filters{gap:6px}.records-header{padding-inline:13px}th:first-child,td:first-child{padding-inline-start:13px}th:last-child,td:last-child{padding-inline-end:13px}.customer-column{display:none}}
@media(max-width:850px){:root{--sidebar-w:155px}.sidebar{padding-inline:10px}.metric{padding-inline:10px}.metric .badge-icon{width:30px;height:30px}.metric .badge-icon .icon{width:16px;height:16px}.records-header{align-items:start;flex-wrap:wrap}.editor-grid{grid-template-columns:1fr}.editor-rail{grid-template-columns:1fr 1fr}.preview-panel{grid-column:1/-1}}
@media(max-width:640px){.shell{display:block}.sidebar{display:none}.topbar{height:57px;padding:0 15px}.topbar-path{display:none}.mobile-brand{display:flex;padding:0}.mobile-brand img{width:72px}.mobile-brand small{display:none}.mobile-account{display:inline-grid}.content{padding:15px 14px calc(88px + env(safe-area-inset-bottom))}.section-head{margin-top:20px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.metric{min-height:68px;padding:8px 10px}.metric strong{font-size:1.34rem}.records{margin-top:20px}.records-header{gap:9px;padding:12px 11px}.filters{width:100%;gap:6px}.filters .searchbox{flex:1;min-width:0}.searchbox input{width:100%;font-size:1rem}.select select{min-width:80px}.filters .sort-filter{display:none}thead{display:none}tbody,table,.table-wrap{display:block}tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:5px;border-top:1px solid var(--line);padding:8px 9px}td{padding:3px!important;border:0;min-width:0}td.type-column,td.date-column,td.customer-column{display:none}.contract-cell{gap:6px}.contract-cell .badge-icon{width:28px;height:28px}.contract-cell .badge-icon .icon{width:16px;height:16px}.contract-cell strong{font-size:.84rem}.contract-cell small{font-size:.72rem}.status{font-size:.72rem;padding:2px 5px}.row-open{width:27px;height:29px}.mobile-nav{position:fixed;z-index:4;bottom:0;inset-inline:0;padding:5px 9px max(6px,env(safe-area-inset-bottom));display:grid;grid-auto-flow:column;grid-auto-columns:1fr;background:#1b1b1bef;backdrop-filter:blur(12px);border-top:1px solid var(--line)}.mobile-nav .nav-item{padding:4px 1px;gap:3px;display:grid;justify-items:center;line-height:1.35;font-size:.75rem;min-height:46px}.mobile-nav .nav-item .icon{width:17px;height:17px}.mobile-nav .nav-item::before{display:none}.notice{bottom:76px;inset-inline-end:14px}.page-head{align-items:start;gap:8px}.page-head-actions{justify-content:end}.page-head-actions .btn{padding-inline:8px;font-size:.8rem}.template-grid,.editor-rail{grid-template-columns:1fr}.dialog-inner{padding:14px}.form-tabs button{padding-inline:8px}.field-grid{gap:8px}.panel-body{padding:11px}.field input,.field textarea{padding-inline:6px}.icon-btn{min-height:38px}.login-card{padding:22px}} 
@media(min-width:641px){.mobile-account{display:none}}
@media(max-width:365px){.field-grid{grid-template-columns:1fr}.page-head{flex-wrap:wrap}.contract-cell .badge-icon{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
.required-marker{color:var(--green-text);display:inline}
.field:has(.required-marker){display:flex;align-items:baseline;flex-wrap:wrap}
.field:has(.required-marker)>input,.field:has(.required-marker)>textarea{flex-basis:100%}
.account-actions{margin-top:12px}
.file-rows small{display:block;color:var(--muted)}
@media(min-width:641px) and (max-width:850px){
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metric{min-height:70px}
}

/* Search filters */
.date-filters {
  display:flex;
  align-items:end;
  flex-wrap:wrap;
  gap:10px;
  margin:0 19px 14px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--bg);
}

.date-field-group {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  flex:1 1 286px;
  min-width:0;
}

.date-field-group > span:first-child,
.date-field-group > p:first-child,
.date-field-group > div:first-child:has(+ .field) {
  grid-column:1/-1;
  color:var(--muted);
  font-size:.82rem;
}

.date-filters > .field {flex:1 1 125px}
.date-filters .field input {font-variant-numeric:tabular-nums}
.date-actions {display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.date-actions .btn {min-height:41px}
.date-error,.date-hint {flex-basis:100%}
.date-hint {color:var(--muted);font-size:.82rem}
.date-range-toggle {min-height:39px;max-width:100%}
.date-range-toggle > span {white-space:normal}
.date-range-toggle[aria-expanded=true],
.date-range-toggle.has-date-range {
  border-color:var(--green);
  color:var(--green-text);
}

/* Manager tools */
.management-nav-title {
  margin-block-start:16px;
  padding-block-start:14px;
  border-block-start:1px solid var(--line);
}

.management-grid,
.backup-admin {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  align-items:start;
}

.management-panel,
.backup-panel {
  min-width:0;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--panel);
  padding:clamp(15px,2.8vw,24px);
}

.management-panel h2,
.backup-panel h2 {
  font-size:1.12rem;
  font-weight:700;
  margin-block-end:8px;
}

.management-panel p,
.backup-panel p {overflow-wrap:anywhere}
.management-panel > p,
.backup-panel > p,
.management-note {
  color:var(--muted);
  line-height:1.7;
  font-size:.88rem;
}

.management-form,
.backup-form {
  display:grid;
  gap:11px;
  margin-block-start:13px;
}

.management-form > .btn,
.backup-form > .btn {justify-self:start}

.management-form + .management-note,
.backup-form + .backup-feedback {margin-block-start:12px}

.management-list {
  display:grid;
  gap:0;
  margin:4px 0 0;
  padding:0;
  list-style:none;
}

.management-row {
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  padding-block:12px;
  border-block-end:1px solid var(--line);
}

.management-row:last-child {border-block-end:0}
.management-row > div {min-width:0}
.management-row strong {display:block;overflow-wrap:anywhere}
.management-row small {color:var(--muted)}
.management-actions {display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.management-actions .btn {min-height:36px;font-size:.83rem}
.management-code,.backup-feedback {
  line-height:1.7;
  overflow-wrap:anywhere;
  margin-block-start:10px;
}
.management-code:not(:empty),.backup-feedback:not(:empty) {
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  background:var(--bg);
}
.management-code code {font-size:.95rem}
.field input.management-code { user-select: text; -webkit-user-select: text; }
.field input.management-code {
  margin-block-start:0;
  direction:ltr;
  font-family:ui-monospace,monospace;
  font-variant-numeric:tabular-nums;
}
.backup-form progress {width:100%;accent-color:var(--green)}
.backup-form input[type=file] {font-size:.85rem}
.management-panel a.btn,.backup-panel a.btn {justify-self:start}

@media(max-width:850px) {
  .sidebar .nav-item {gap:8px;padding-inline:9px;font-size:.85rem}
  .management-grid,.backup-admin {grid-template-columns:1fr}
}

@media(max-width:640px) {
  .date-filters {margin-inline:11px;gap:8px;padding:10px}
  .filters .searchbox {flex-basis:100%}
  .date-actions .btn {min-height:39px;padding-inline:11px}
  .mobile-nav .nav-item {white-space:normal;text-align:center}
  .mobile-nav .nav-item span {max-width:100%}
}

@media(max-height:690px) and (min-width:641px) {
  .sidebar {padding-block-start:18px}
  .side-nav {margin-block-start:24px}
}
.backup-scope {grid-column:1/-1}
.backup-reminder {
  margin-block:14px;
  padding:10px 13px;
  border:1px solid #49604a;
  border-radius:12px;
  background:var(--panel);
}
.backup-reminder-row,.backup-month-links {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.backup-reminder-row > .icon {color:var(--green-text)}
.backup-reminder-row > p {margin:0;font-size:.9rem;flex:1 1 190px}
.backup-reminder details {margin-block-start:8px;font-size:.85rem;color:var(--muted)}
.backup-reminder summary {cursor:pointer;width:fit-content}
.backup-month-links {margin-block-start:8px}
.backup-file-control {
  position:relative;
  display:inline-grid;
  width:max-content;
  max-width:100%;
}
.backup-file-control > input[type=file] {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  opacity:0;
  cursor:pointer;
}
.backup-file-control:hover > .btn {background:var(--panel-up)}
.backup-file-control:focus-within > .btn {outline:2px solid var(--focus);outline-offset:3px}
.backup-filename {overflow-wrap:anywhere}

.reset-filters{min-height:39px;color:var(--muted)}
@media(max-width:640px){
  .record-row{border-inline-start:3px solid var(--record-accent,var(--line))}
  .record-row>td:first-child{border-inline-start:0}
  .record-mobile-date{display:inline;white-space:nowrap}
  .record-row .status-column,.record-row .action-column{width:auto}
}
.status-guide-link{min-height:38px;color:var(--muted)}
.status-guide-steps{display:grid;gap:12px;margin:0;padding:0;list-style:none}
.status-guide-steps li{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:start;gap:8px;padding-block:8px}
.status-guide-steps .status{justify-self:start}
.status-guide-steps p,.dialog-note{color:var(--muted);font-size:.9rem}
.dialog-note{margin-block:8px}
.dialog-actions{margin-block-start:18px}
.dialog-actions .danger{border-color:#764841}
.workflow-note{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline;padding:10px 13px;margin-block-end:14px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--muted);font-size:.86rem}
.workflow-note strong{color:var(--text);font-weight:600}
.record-next-step{display:block;margin-block-start:4px;color:var(--muted);white-space:normal;line-height:1.4;font-size:.72rem}
.trash-list{margin:0;padding:0;list-style:none}
.trash-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px 14px;padding:13px 16px;border-block-end:1px solid var(--line)}
.trash-row:last-child{border-block-end:0}
.trash-details{min-width:0;overflow-wrap:anywhere}
.trash-details strong,.trash-details small{display:block}
.trash-details small{color:var(--muted);font-size:.78rem}
@media(max-width:640px){
  .status-guide-link{padding-inline:8px;font-size:.8rem}
  .record-next-step{max-width:84px}
  .trash-row{grid-template-columns:minmax(0,1fr) auto}
  .trash-details{grid-column:1/-1}
  .trash-row .status,.trash-row .btn{justify-self:start}
  .trash-row .btn{justify-self:end}
}
@media(max-height:690px) and (min-width:641px){
  .side-nav{overflow-y:auto}
}
.contract-details{min-width:0;overflow-wrap:anywhere}
.contract-cell .record-references{display:flex;flex-wrap:wrap;gap:2px 10px}
.record-document-number{color:#ddd}
.field-note{font-size:.76rem;color:var(--muted);font-weight:400}
.field .internal-code{color:#c4c4c4;background:var(--panel);font-variant-numeric:tabular-nums}

.workspace-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px .6rem;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.workspace-clock bdi { font-variant-numeric: tabular-nums; }
.record-actions { display: inline-flex; gap: 4px; align-items: center; }
.pending-note-action[data-has-note="true"] { color: var(--green-text); }
.attachment-preview { display: block; max-width: 100%; max-height: 72dvh; margin: auto; object-fit: contain; }

@media (min-width: 851px) {
  .editor-grid:has([data-contract-steps-layout]) .editor-rail {
    position: sticky;
    top: 16px;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    scrollbar-width: thin;
  }
  .editor-grid:has([data-contract-steps-layout]) .paper-preview {
    max-height: clamp(380px, 64dvh, 630px);
  }
}
@media (max-width: 640px) {
  .workspace-clock { gap: 0 .4rem; font-size: .7rem; line-height: 1.35; }
  .workspace-clock > span { flex-basis: 100%; }
  .topbar:has(.workspace-clock) .demo-label { display: none; }
}
.attachment-pdf-preview { display: block; width: 100%; height: min(65dvh, 710px); margin-block-start: 10px; border: 0; background: #fff; }

.record-actions { display: flex; justify-content: flex-end; }
.record-actions .row-open { flex: none; margin-inline: 0; }
.record-actions button.row-open { background: var(--panel); padding: 0; }
.contract-note-preview {
  position: fixed; z-index: 30; pointer-events: none;
  max-width: min(320px, calc(100vw - 16px)); max-height: 180px;
  padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-up); color: var(--text); box-shadow: 0 6px 16px #0008;
  overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .82rem;
}
.certification-editor { display: grid; gap: 4px; }
.certification-editor textarea { width:100%; min-height: 3rem; color:#222; background:#fff; border:1px solid #aaa; font:inherit; }
.paper-preview .document-value { color: #151515; }

.reminder-bell { position: relative; }
.reminder-count {
  position: absolute; inset-block-start: -5px; inset-inline-end: -5px; padding-inline: 4px;
  min-width: 18px; border-radius: 20px; background: var(--green); color: #101612;
  font-size: .67rem; line-height: 18px; font-weight: 700; text-align: center;
}
.reminder-dashboard { margin-block: 18px; }
.reminder-dashboard:has([aria-expanded="false"][aria-controls="dashboard-reminder-items"]) .panel-heading { border-block-end: 0; }
.reminder-dashboard [aria-expanded="true"][aria-controls="dashboard-reminder-items"] .icon { transform: rotate(180deg); }
.contract-due-panel { margin-block-end: 14px; }
.reminder-summary { cursor: pointer; font-size: .86rem; color: var(--muted); padding: 9px 15px; }
.reminder-summary span { margin-inline-start: 6px; color: var(--green-text); }
.reminder-filters { margin-block-end: 12px; flex-wrap: wrap; }
.reminder-search { max-inline-size: 28rem; margin-block-end: 10px; }
.reminder-search input { inline-size: 100%; }
.reminder-rows { list-style: none; margin: 0; padding: 0; }
.reminder-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-block: 10px; border-block-end: 1px solid var(--line);
}
.reminder-row:last-child { border: 0; }
.reminder-copy { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.reminder-copy small, .reminder-empty { color: var(--muted); }
.reminder-empty { margin: 0; font-size: .87rem; }
.reminder-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reminder-status {
  color: var(--muted); background: var(--panel-up); border-radius: 20px;
  padding: 3px 8px; font-weight: 600; font-size: .75rem; white-space: nowrap;
}
.reminder-status[data-due-status="near"] { color: #efdca0; background: #3a311d; }
.reminder-status[data-due-status="late"] { color: #f9bfbc; background: #442626; }
.reminder-status[data-due-status="done"] { color: var(--green-text); background: #203b2a; }
@media (max-width: 640px) {
  .reminder-row { align-items: flex-start; flex-direction: column; }
  .reminder-row-actions .btn { min-height: 36px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .reminder-bell { min-width: 34px; }
}

.reminder-groups { display: grid; gap: 8px; }
.reminder-group { border: 1px solid var(--line); border-radius: 10px; }
.reminder-group-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; list-style: none; border-radius: inherit;
}
.reminder-group-summary::-webkit-details-marker { display: none; }
.reminder-group-summary:hover, .reminder-group[open] > summary { background: var(--panel-up); }
.reminder-group-summary > .icon { width: 14px; height: 14px; color: var(--muted); }
.reminder-group[open] > summary > .icon { transform: rotate(180deg); }
.reminder-group-count {
  border-radius: 20px; padding: 3px 8px; color: var(--green-text); background: #203b2a;
  font-size: .78rem; white-space: nowrap;
}
.reminder-group-body { padding: 0 12px 10px; }
.reminder-group-body > a { color: var(--green-text); }
.reminder-group-body .reminder-rows { margin-block-end: 5px; }
