:root{--bg:#eef4fb;--side:#0d1b32;--side2:#152944;--blue:#0d8df2;--cyan:#23c7e8;--card:#fff;--text:#172033;--muted:#718096;--line:#dbe6f2;--green:#27ae7e;--red:#e64b5d;--orange:#f5a623}*{box-sizing:border-box}body{margin:0;font-family:Arial,'Helvetica Neue',sans-serif;background:var(--bg);color:var(--text)}.app{display:grid;grid-template-columns:260px 1fr;min-height:100vh}.sidebar{background:linear-gradient(180deg,var(--side),var(--side2));color:#b6c6dc;padding:26px 20px;position:sticky;top:0;height:100vh}.logo{display:flex;gap:12px;align-items:center;margin-bottom:34px}.mark{width:46px;height:46px;border-radius:13px;background:linear-gradient(135deg,var(--blue),var(--cyan));display:grid;place-items:center;color:#fff;font-weight:800}.logo b{color:#fff;display:block;letter-spacing:.4px}.logo span{font-size:12px;color:#8fa8c6}.nav a{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:12px;color:#b6c6dc;text-decoration:none;margin:5px 0;font-size:14px}.nav a.active,.nav a:hover{background:rgba(255,255,255,.09);color:#fff}.nav-icon{flex-shrink:0;width:32px;height:32px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.06);color:#9db3cc;transition:background .15s,color .15s,transform .15s}.nav-icon svg{display:block;width:18px;height:18px}.nav a.active .nav-icon,.nav a:hover .nav-icon{background:rgba(255,255,255,.14);color:#fff;transform:translateY(-1px)}.nav a.active .nav-icon{background:linear-gradient(135deg,rgba(13,141,242,.35),rgba(35,199,232,.25));color:#fff;box-shadow:0 4px 14px rgba(13,141,242,.2)}.nav small{margin-left:auto;background:#1e9cf0;color:#fff;border-radius:9px;padding:2px 7px;font-size:11px;font-weight:700;min-width:22px;text-align:center}.main{padding:0 28px 32px}.topbar{height:74px;display:flex;align-items:center;justify-content:space-between}.hamb{font-size:24px;color:#4d617a}.tools{display:flex;align-items:center;gap:16px;color:#51627a}.user{display:flex;gap:10px;align-items:center;background:#fff;padding:6px 14px 6px 6px;border-radius:999px;border:1px solid var(--line);box-shadow:0 4px 14px rgba(16,43,76,.06);transition:box-shadow .18s,border-color .18s,transform .18s}.user:hover{box-shadow:0 8px 22px rgba(16,43,76,.12);border-color:#c6d8ec;transform:translateY(-1px)}.avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--blue),var(--cyan));display:grid;place-items:center;color:#fff;font-weight:800;font-size:15px;text-transform:uppercase;box-shadow:0 4px 10px rgba(13,141,242,.35);flex-shrink:0}.user-name{font-weight:600;font-size:14px;color:#2a3a52;text-transform:capitalize;letter-spacing:.2px;white-space:nowrap}.page-title{font-size:24px;font-weight:800;margin:0 0 18px}.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.stat{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:0 10px 30px rgba(16,43,76,.06);min-height:120px}.stat .row{display:flex;justify-content:space-between;align-items:center}.stat p{margin:0;color:var(--muted);font-size:14px}.stat h2{margin:15px 0 0;font-size:28px}.ico{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:#e9f7ff;color:var(--blue)}.panel{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 10px 30px rgba(16,43,76,.06);padding:20px}.dashboard{display:grid;grid-template-columns:1fr 330px;gap:18px;margin-top:18px}.panel h3{margin:0 0 16px;font-size:16px}.chart-placeholder{height:305px;border-radius:14px;background:linear-gradient(180deg,#fbfdff,#f3f8fd);position:relative;overflow:hidden}.chart-placeholder svg{width:100%;height:100%}.donut{height:290px;display:grid;place-items:center}.donut-circle{width:180px;height:180px;border-radius:50%;border:32px solid #1b84e7;display:grid;place-items:center;color:#73839b;text-align:center}.org-search{width:100%}.badge{display:inline-flex;padding:4px 9px;border-radius:9px;font-size:12px;font-weight:700;color:#fff;background:var(--cyan);margin-left:8px}.badge.red{background:#ef5e7a}.btn{display:inline-block;text-decoration:none;border:0;border-radius:11px;padding:12px 17px;background:var(--blue);color:#fff;font-weight:700;cursor:pointer}.btn.red{background:var(--red)}.btn.ghost{background:#edf4fb;color:#52667d}.btn.green{background:var(--green)}.btn.orange{background:var(--orange)}.top-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px}.archive-layout{display:grid;grid-template-columns:420px 1fr;gap:22px}.tree{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px;min-height:520px}.searchbox{width:100%;padding:14px 15px;border:1px solid var(--line);border-radius:12px;margin-bottom:16px}.tree ul{list-style:none;padding-left:18px;margin:0}.tree li{padding:7px 0;color:#39506b;font-size:14px}.tree .folder:before{content:'▣';color:#1b8de5;margin-right:7px}.tree .unit:before{content:'□';color:#df5265;margin-right:7px}.tree .selected{background:#eaf6ff;border-radius:8px;padding-left:8px}.context{position:fixed;background:#fff;border:1px solid #b8cadc;box-shadow:0 12px 35px rgba(0,0,0,.16);border-radius:8px;overflow:hidden;display:none;z-index:2000}.context button{display:block;width:150px;padding:12px;border:0;text-align:left;background:#fff;cursor:pointer}.context button:hover{background:#edf6ff}.upload{border:2px dashed #bfd5ec;border-radius:18px;background:#fbfdff;padding:40px;text-align:center;color:#657890}.upload .cloud{font-size:44px;color:#228ee8}.file-table,.param-table{width:100%;border-collapse:collapse;margin-top:18px;background:#fff;border-radius:14px;overflow:hidden}.file-table th,.file-table td,.param-table td,.param-table th{border-bottom:1px solid var(--line);padding:14px;text-align:left;font-size:14px}.file-table th,.param-table th{color:#60758c;background:#f6f9fd}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.field label{display:block;font-size:13px;color:#63758c;margin-bottom:7px}.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);border-radius:11px;padding:12px;background:#fff}.field.w2{grid-column:span 2}.field.w4{grid-column:span 4}.actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.search-result{margin-top:18px;padding:18px;background:#fff;border:1px solid var(--line);border-radius:14px;color:#718096}.search-result b{color:#e64b5d}.modal{position:fixed;inset:0;background:rgba(8,20,39,.45);display:none;align-items:center;justify-content:center;padding:22px;z-index:10040}.modal.show{display:flex}.modal-box{background:#fff;border-radius:18px;width:min(820px,100%);padding:20px;box-shadow:0 24px 80px rgba(0,0,0,.2)}.modal-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:16px}.close{border:0;background:#edf4fb;border-radius:9px;padding:8px 10px;cursor:pointer}.profile-card{width:360px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:24px;box-shadow:0 10px 30px rgba(16,43,76,.06)}.profile-card .big-avatar{width:72px;height:72px;border-radius:50%;background:#eef5fc;display:grid;place-items:center;font-size:34px}.kv{margin-top:14px}.kv small{display:block;color:#718096;text-transform:uppercase;margin-bottom:4px}.org-box{border:1px solid var(--line);padding:10px;border-radius:8px;margin:7px 0;color:#52667d}.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#06182f,#0a7fde)}.login-card{width:430px;background:#fff;border-radius:24px;padding:34px;box-shadow:0 30px 90px rgba(0,0,0,.25)}.login-card h1{margin:8px 0}.login-card input{width:100%;padding:14px;border:1px solid var(--line);border-radius:12px;margin:8px 0}.note{background:#fff8e6;border:1px solid #ffe0a6;color:#8a5a00;border-radius:14px;padding:14px;margin-top:14px;font-size:14px}@media(max-width:1100px){.app{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.grid4,.dashboard,.archive-layout{grid-template-columns:1fr}.orgs{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.field.w2,.field.w4{grid-column:auto}.main{padding:0 16px 24px}}
.muted{color:var(--muted);margin:8px 0 0}.context a{display:block;width:150px;padding:12px;text-align:left;background:#fff;color:#172033;text-decoration:none}.context a:hover{background:#edf6ff}.dept{cursor:default}.dept-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.dept-name{flex:1;line-height:1.4}.dept-menu-btn{flex-shrink:0;border:1px solid var(--line);background:#f4faff;color:#0d8df2;border-radius:8px;width:28px;height:28px;cursor:pointer;font-size:18px;line-height:1;padding:0}.dept-menu-btn:hover{background:#0d8df2;color:#fff}.unit-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.unit-number{flex:1}.unit-menu-btn{flex-shrink:0;border:1px solid var(--line);background:#fff5f6;color:#e64b5d;border-radius:8px;width:24px;height:24px;cursor:pointer;font-size:16px;line-height:1;padding:0;opacity:0;transition:opacity .15s}.unit:hover .unit-menu-btn,.unit.selected .unit-menu-btn{opacity:1}.unit-menu-btn:hover{background:#e64b5d;color:#fff}.context .ctx-delete-btn{display:block;width:100%;padding:12px;text-align:left;background:#fff;color:#e64b5d;border:none;border-top:1px solid var(--line);cursor:pointer;font:inherit}.context .ctx-delete-btn:hover{background:#fff0f3}.tree .unit{cursor:pointer;border-radius:8px;padding:7px 8px;margin:2px 0;transition:background .15s}.tree .unit:hover{background:#fff0f3}.tree .unit.selected{background:var(--red);color:#fff;font-weight:700}.panel textarea{resize:vertical}
.detail-grid{display:grid;grid-template-columns:1.4fr .8fr;gap:18px}.info-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.info-grid div{border:1px solid var(--line);background:#f8fbff;border-radius:12px;padding:13px}.info-grid small{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}.info-grid b{font-size:14px;color:#223650}.file-card{display:flex;gap:14px;align-items:flex-start;border:1px solid var(--line);background:#f8fbff;border-radius:14px;padding:14px}.pdf-icon{width:58px;height:70px;border-radius:10px;background:#e64b5d;color:#fff;font-weight:800;display:grid;place-items:center}.file-card p{margin:6px 0;color:var(--muted);font-size:13px}.icon-link{color:#0d8df2;text-decoration:none;font-weight:700;margin-right:8px}.trash{color:#e64b5d}.pdf-layout{display:grid;grid-template-columns:280px 1fr;gap:18px;align-items:start}.pdf-meta p{font-size:14px;color:#52667d;line-height:1.6;margin:10px 0}.pdf-viewer{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;display:flex;flex-direction:column;min-height:calc(100vh - 200px)}.pdf-toolbar{height:54px;background:#f6f9fd;border-bottom:1px solid var(--line);display:flex;gap:8px;align-items:center;padding:0 14px;flex-shrink:0}.pdf-toolbar button{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px 12px;cursor:pointer;font-weight:700;color:#33506c}.pdf-toolbar button:hover{background:#edf6ff;border-color:#0d8df2}.pdf-toolbar span{min-width:52px;text-align:center;font-weight:700;color:#52667d}.pdf-toolbar-hint{flex:1;font-size:13px;font-weight:600;color:#6b7f96;text-align:left;min-width:0}.pdf-frame-wrap{flex:1;min-height:calc(100vh - 260px);background:#525659;overflow:auto}.pdf-frame-wrap iframe{display:block;width:100%;height:100%;min-height:calc(100vh - 260px);border:none;background:#525659}.pdf-viewer:fullscreen{min-height:100vh;border-radius:0}.pdf-viewer:fullscreen .pdf-frame-wrap{min-height:calc(100vh - 54px)}.pdf-page{margin:24px auto;background:#fff;width:78%;min-height:560px;border:1px solid #cfd8e3;box-shadow:0 18px 45px rgba(16,43,76,.12);display:grid;place-items:center;text-align:center;padding:40px}.pdf-page code{background:#eef4fb;padding:4px 7px;border-radius:6px}@media(max-width:1100px){.detail-grid,.pdf-layout,.info-grid{grid-template-columns:1fr}.pdf-page{width:92%}.pdf-viewer{min-height:70vh}.pdf-frame-wrap,.pdf-frame-wrap iframe{min-height:60vh}}

.upload-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:14px}.upload-choice{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-weight:800;color:#33506c}.upload-choice input{display:none}.upload-choice:hover{border-color:#0d8df2;background:#f4faff}.upload-choice.is-disabled,.upload-choice.is-disabled:hover{opacity:.45;cursor:not-allowed;border-color:var(--line);background:#f6f9fd;color:#8fa3b8;pointer-events:none}.upload--full{border-color:#d4deea;background:#f6f9fd;color:#8fa3b8}.type-badge{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800;color:#fff}.type-badge.pdf{background:#e64b5d}.type-badge.image{background:#27ae7e}.type-badge.video{background:#7b61ff}.type-badge.audio{background:#f5a623}.media-icon{width:58px;height:70px;border-radius:10px;color:#fff;font-weight:800;display:grid;place-items:center}.media-icon.image{background:#27ae7e}.media-icon.video{background:#7b61ff}.media-icon.audio{background:#f5a623}.file-stack{display:grid;gap:12px}.media-preview{background:#fff;border:1px solid var(--line);border-radius:18px;min-height:560px;display:grid;place-items:center;overflow:hidden}.mock-image{width:min(720px,90%);height:420px;border-radius:18px;background:linear-gradient(135deg,#dff2ff,#ffffff 45%,#d9f7e8);border:1px solid var(--line);display:grid;place-items:center;text-align:center;color:#51627a}.mock-video{width:min(820px,92%);background:#111827;border-radius:18px;padding:18px;color:#fff}.video-screen{height:390px;border-radius:14px;background:linear-gradient(135deg,#1e293b,#0f172a);display:grid;place-items:center;font-size:70px}.video-controls{display:flex;align-items:center;gap:12px;margin-top:14px}.video-bar{height:8px;background:#334155;border-radius:99px;flex:1;overflow:hidden}.video-bar span{display:block;width:38%;height:100%;background:#0d8df2}
@media(max-width:1100px){.upload-actions{grid-template-columns:1fr}}

/* Sidebar toggle + layout polish */
.app{transition:grid-template-columns .22s ease}
.sidebar{display:flex;flex-direction:column}
.sidebar .nav{flex:1;display:flex;flex-direction:column;min-height:0}
.sidebar .nav .nav-item-bottom{margin-top:auto;padding-top:12px}
.sidebar{transition:transform .22s ease,opacity .22s ease,visibility .22s ease;z-index:1001}
.hamb{cursor:pointer;border:none;background:transparent;padding:8px 10px;border-radius:10px;line-height:1;font-size:24px;color:#4d617a}
.hamb:hover{background:#edf4fb}
.logout-form{display:inline-flex}
.lang-form{display:inline-flex;align-items:center}
.lang-select{height:38px;padding:0 28px 0 10px;border:1px solid var(--line);background:#fff;color:#4d617a;border-radius:10px;font-size:13px;cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234d617a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}
.lang-select:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.logout-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;padding:0;border:1px solid var(--line);background:#fff;color:#5a6b82;border-radius:10px;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.logout-btn:hover{background:#fff0f3;color:var(--red);border-color:#f3c3cb}
.logout-btn:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.logout-btn svg{display:block}
.action-chip-group{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:10px;background:#f4f8fc;border:1px solid #e3edf7}
.action-chip-group form{display:inline-flex;margin:0}
.action-chip{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:7px;background:transparent;color:#5a6b82;font:inherit;line-height:0;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background .15s,color .15s,transform .15s}
.action-chip svg{display:block;width:15px;height:15px;pointer-events:none}
.action-chip:hover{transform:translateY(-1px)}
.action-chip--restore:hover{background:#e8f8f1;color:var(--green)}
.action-chip--danger:hover{background:#fff0f3;color:var(--red)}
.action-chip:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
.action-chip--danger:focus-visible{outline-color:var(--red)}
.recycle-col-actions{width:1%;white-space:nowrap;vertical-align:middle}
.recycle-action-hint{display:block;margin-top:4px;max-width:140px;font-size:11px;line-height:1.35;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.sidebar-collapsed .app{grid-template-columns:0 minmax(0,1fr)}
body.sidebar-collapsed .sidebar{transform:translateX(-100%);opacity:0;visibility:hidden;pointer-events:none;overflow:hidden}
.top-actions{flex-wrap:wrap;align-items:flex-start;gap:12px 16px}
.top-actions>.page-title{flex:1 1 220px;min-width:0}
.page-title--flush{margin:0}
.top-actions>div:last-child{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.archive-layout{align-items:start}
.archive-layout>.tree{min-width:0}
.archive-layout>div:last-child{min-width:0}
.main{min-width:0}
.unit-panel-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px 16px;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.unit-panel-title{flex:1 1 220px;min-width:0}
.unit-panel-title h2{margin:0;font-size:20px;line-height:1.35;word-break:break-word;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.unit-panel-title .muted{margin:6px 0 0;font-size:14px}
.unit-panel-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:0 1 auto}
.unit-panel-actions form{margin:0;display:flex}
.unit-panel-actions .btn{white-space:nowrap}
.upload h2{font-size:18px;line-height:1.4;margin:12px 0 8px}
.file-table{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.file-col-actions{width:1%;white-space:nowrap;vertical-align:middle}
.param-table th.param-col-actions{width:1%;white-space:nowrap;vertical-align:middle;text-align:right}
.file-row-actions{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap;white-space:nowrap}
.file-row-actions form{margin:0;display:inline-flex}
.file-action-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#52667d;cursor:pointer;font-size:14px;line-height:1;text-decoration:none;padding:0;flex-shrink:0;font-family:inherit;-webkit-appearance:none;appearance:none;transition:background .15s,border-color .15s,color .15s}
.file-action-btn:hover{background:#f4faff;border-color:#b8d9f5;color:#0d8df2}
.file-action-btn--delete{color:#c0394a;border-color:#f5c6cb;background:#fff5f6}
.file-action-btn--delete:hover{background:var(--red);border-color:var(--red);color:#fff}
.file-action-link{display:inline-flex;align-items:center;padding:6px 10px;border-radius:8px;background:#edf6ff;color:#0d8df2;text-decoration:none;font-weight:700;font-size:13px;line-height:1.2;white-space:nowrap;transition:background .15s,color .15s}
.file-action-link:hover{background:#0d8df2;color:#fff}
@media(max-width:1100px){
  body.sidebar-collapsed .app{grid-template-columns:1fr}
  body.sidebar-open::before{content:"";position:fixed;inset:0;background:rgba(13,27,50,.45);z-index:1000}
  body.sidebar-open .sidebar{position:fixed;left:0;top:0;width:260px;height:100vh;transform:none;opacity:1;visibility:visible;pointer-events:auto;overflow:auto}
  body.sidebar-collapsed .sidebar{position:fixed;left:0;top:0;width:260px;height:100vh}
  .archive-layout{grid-template-columns:1fr}
  .unit-panel-actions{width:100%;justify-content:flex-start}
}
@media(max-width:720px){
  .top-actions>div:last-child,.unit-panel-actions{width:100%}
  .top-actions>div:last-child .btn,.unit-panel-actions .btn{flex:1 1 auto;text-align:center;justify-content:center}
}
.tree .unit.selected:before{color:#fff}
.tree .unit.selected .unit-menu-btn{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.45);color:#fff;opacity:1}
.tree .unit.selected .unit-menu-btn:hover{background:#fff;color:var(--red)}
.tree .unit.selected:hover{background:var(--red)}

/* Qismən arxiv saxlama vahidləri */
.tree .unit.unit-partial{background:#fff8eb;border:1px dashed #f0b429}
.tree .unit.unit-partial:before{content:'◆';color:var(--orange)}
.tree .unit.unit-partial:hover{background:#fff3d6}
.tree .unit.unit-partial.selected{background:var(--orange);border-color:var(--orange);color:#fff}
.tree .unit.unit-partial.selected:before{color:#fff}
.tree .unit.unit-partial.selected .unit-scope-tag{background:rgba(255,255,255,.22);color:#fff}
.tree .unit.unit-partial.selected .unit-menu-btn{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.45);color:#fff;opacity:1}
.tree .unit.unit-partial.selected .unit-menu-btn:hover{background:#fff;color:var(--orange)}
.tree .unit.unit-partial.selected:hover{background:var(--orange)}
.unit-scope-tag{display:inline-flex;margin-left:8px;padding:2px 7px;border-radius:999px;background:#ffe8b8;color:#9a6700;font-size:11px;font-weight:800;vertical-align:middle}
.archive-scope-badge{display:inline-flex;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:800;vertical-align:middle;margin-left:0}
.archive-scope-badge.full{background:#e9f7ff;color:#0d8df2}
.archive-scope-badge.partial{background:#fff3d6;color:#9a6700;border:1px solid #f0b429}
.unit-panel-partial{border-bottom-color:#f0b429}
.unit-panel-partial+.upload,.unit-panel-head.unit-panel-partial~.upload{border-color:#f0b429;background:#fffdf7}

/* Confirm dialog */
.confirm-modal{z-index:10050;backdrop-filter:blur(4px);background:rgba(8,20,39,.52)}
.confirm-modal.show{align-items:center;justify-content:center}
.confirm-box{background:#fff;border-radius:20px;width:min(420px,calc(100% - 32px));padding:28px 28px 24px;box-shadow:0 28px 90px rgba(8,20,39,.28);text-align:center;animation:confirm-in .22s ease}
@keyframes confirm-in{from{opacity:0;transform:scale(.94) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}
.confirm-icon{width:56px;height:56px;border-radius:16px;display:grid;place-items:center;font-size:26px;margin:0 auto 16px}
.confirm-icon.danger{background:#fff0f3;color:var(--red)}
.confirm-icon.default{background:#edf6ff;color:var(--blue)}
.confirm-title{margin:0 0 10px;font-size:20px;font-weight:800;color:#172033}
.confirm-message{margin:0 0 22px;font-size:15px;line-height:1.55;color:#52667d}
.confirm-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.confirm-actions .btn{min-width:120px;padding:12px 18px}

/* Archive tree UX */
.fond-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.fond-name{flex:1;line-height:1.4}
.fond-menu-btn{flex-shrink:0;border:1px solid var(--line);background:#f4faff;color:#0d8df2;border-radius:8px;width:28px;height:28px;cursor:pointer;font-size:18px;line-height:1;padding:0;opacity:0;transition:opacity .15s}
.fond:hover .fond-menu-btn,.fond.selected .fond-menu-btn{opacity:1}
.fond-menu-btn:hover{background:#0d8df2;color:#fff}
.tree .fond{cursor:pointer;border-radius:8px;padding:4px 6px;margin:2px 0}
.tree .fond.selected{background:#eaf6ff;font-weight:700}
.tree-empty-hint{list-style:none;padding:4px 0!important;font-size:13px;margin:0}
.tree-empty-hint a{color:#0d8df2;text-decoration:none;font-weight:700}
.tree-empty-hint a:hover{text-decoration:underline}

/* Tree node layout — +/- toggles, connector lines, compact units */
.tree .folder:before,.tree .unit:before{content:none!important;display:none}
.tree > ul{padding-left:0}
.tree ul.tree-children{
  list-style:none;
  margin:0;
  padding:0 0 0 26px;
  position:relative;
}
.tree li.dept>.tree-children{
  margin-top:10px;
  padding-top:6px;
}
.tree ul.tree-children::before{
  content:"";
  position:absolute;
  left:11px;
  top:0;
  bottom:10px;
  border-left:1px solid #c5d4e3;
}
.tree ul.tree-children > li{
  position:relative;
  padding:0;
  margin:0;
}
.tree ul.tree-children > li::before{
  content:"";
  position:absolute;
  left:-15px;
  top:14px;
  width:15px;
  border-top:1px solid #c5d4e3;
}
.tree ul.tree-children > li.unit::before{display:none}
.tree ul.tree-children > li:last-child::after{
  content:"";
  position:absolute;
  left:-16px;
  top:15px;
  bottom:0;
  width:3px;
  background:#fff;
}
.tree li.unit{
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  padding:8px 8px 8px 0;
  margin:4px 0;
  min-height:32px;
  line-height:1.35;
}
.tree-node-head{
  display:flex;
  align-items:center;
  gap:6px;
  flex:1;
  min-width:0;
  padding:3px 8px 3px 0;
  margin:0;
  min-height:26px;
  border-radius:4px;
  cursor:pointer;
  user-select:none;
}
.tree-node-head:hover{background:#f4faff}
.tree .fond.selected>.tree-node-head,.tree .dept.selected>.tree-node-head{
  background:var(--blue);
  color:#fff;
  font-weight:700;
}
.tree .fond.selected>.tree-node-head .tree-icon,
.tree .dept.selected>.tree-node-head .tree-icon{color:#fff}
.tree .fond.selected>.tree-node-head .fond-menu-btn,
.tree .dept.selected>.tree-node-head .dept-menu-btn{
  background:rgba(255,255,255,.15);
  border-color:rgba(255,255,255,.35);
  color:#fff;
  opacity:1;
}
.tree-toggle{
  width:15px;
  height:15px;
  flex-shrink:0;
  border:1px solid #a8bdd4;
  background:#fff;
  border-radius:2px;
  display:grid;
  place-items:center;
  font-size:11px;
  font-weight:700;
  line-height:1;
  color:#52667d;
}
.tree-toggle::before{content:"−";display:block}
.tree-toggle-hidden{visibility:hidden}
.tree li.collapsed>ul{display:none!important}
.tree li.collapsed>.tree-node-head .tree-toggle::before{content:"+"}
.tree-icon{flex-shrink:0;width:16px;text-align:center;line-height:1.5;color:#1b8de5;font-size:13px}
.tree-icon.unit-icon{
  position:relative;
  width:18px;
  height:15px;
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
}
.tree-icon.unit-icon::before{
  content:"";
  position:absolute;
  left:-15px;
  top:50%;
  width:15px;
  border-top:1px solid #c5d4e3;
  transform:translateY(-50%);
  z-index:1;
  pointer-events:none;
}
.tree .unit.selected .tree-icon.unit-icon::before,
.tree .unit.unit-partial.selected .tree-icon.unit-icon::before{
  left:-23px;
  width:15px;
}
.tree-icon.unit-icon svg{
  width:18px;
  height:15px;
  display:block;
}
.tree-icon.unit-icon svg path{
  fill:#F2C94C;
  stroke:#C9952F;
  stroke-width:.5;
}
.unit-partial>.tree-icon.unit-icon svg path{
  fill:#F5A623;
  stroke:#D4920A;
}
.tree .unit.selected .tree-icon.unit-icon svg path,
.tree .unit.unit-partial.selected .tree-icon.unit-icon svg path{
  fill:#fff;
  stroke:rgba(255,255,255,.55);
}
.tree-label,.fond-row,.dept-row,.unit-row{flex:1;min-width:0}
.tree .fond-row,.tree .dept-row,.tree .unit-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px 0 0;margin:0;width:100%}
.tree .unit-menu-btn,.tree .fond-menu-btn,.tree .dept-menu-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:center;
}
.tree li.folder{padding:0}
.tree-empty-hint{padding-left:0!important}
.tree .fond.selected,.tree .dept.selected{background:transparent;padding-left:0;font-weight:inherit}
.tree .fond,.tree .dept{cursor:default;padding:0;margin:0}
.tree li.folder{padding:0;margin:0;color:#39506b;font-size:14px}
.tree li.unit{color:#39506b;font-size:14px}
.tree li.folder.selected,.tree li.fond.selected,.tree li.dept.selected{padding-left:0;border-radius:0;background:transparent}
.tree .unit.selected{padding:8px 8px 8px 8px;border-radius:8px}
.tree .unit.unit-partial.selected{padding:8px 8px 8px 8px;border-radius:8px}
.archive-hint{margin-bottom:16px}
.empty-state{text-align:center;padding:36px 28px}
.empty-state-icon{font-size:48px;margin-bottom:12px}
.empty-state h2{margin:0 0 8px;font-size:22px}
.empty-steps{text-align:left;max-width:360px;margin:20px auto;color:#52667d;line-height:1.7;padding-left:20px}
.empty-state .btn{margin-top:8px}
.archive-panel{min-width:0}
.form-alert{border-radius:12px;padding:14px 16px;margin-bottom:16px;font-size:14px;line-height:1.5}
.form-alert.error{background:#fff0f3;border:1px solid #f5c2cb;color:#9b1c31}
.form-alert.error p{margin:4px 0 0}
.field-error{margin:6px 0 0;font-size:13px;color:#c0392b;font-weight:600}
.field.has-error input,.field.has-error select,.field.has-error textarea{border-color:#e64b5d;background:#fffafb}
.note.msg-error{background:#fff0f3;border-color:#f5c2cb;color:#9b1c31}
.note.msg-success{background:#eefaf4;border-color:#b8e6cf;color:#1e7e4a}

/* Organizations */
.org-search-form{margin-bottom:0}
.org-search{
  width:100%;
  padding:14px 18px 14px 44px;
  border:1px solid var(--line);
  border-radius:14px;
  font-size:15px;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3'/%3E%3C/svg%3E") 16px center/18px no-repeat;
  transition:border-color .15s,box-shadow .15s;
}
.org-search:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(13,141,242,.12);
}
.orgs{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));
  gap:20px;
  margin-top:18px;
  width:100%;
}
.orgs>.note{grid-column:1/-1}
.org-card{
  position:relative;
  display:flex;
  flex-direction:column;
  background:#fff;
  border:2px solid #91c9ff;
  border-radius:16px;
  padding:26px 22px;
  text-align:center;
  box-shadow:0 10px 30px rgba(16,43,76,.06);
  height:100%;
}
.org-card-brief{
  width:42px;
  height:42px;
  border-radius:13px;
  background:#f0f7ff;
  margin:0 auto 16px;
  display:grid;
  place-items:center;
  color:#2479bd;
  font-size:20px;
}
.org-card h3{
  margin:0 0 18px;
  font-size:16px;
  font-weight:800;
  line-height:1.35;
  color:var(--text);
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.org-stat-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 10px;
  font-size:14px;
  color:#39506b;
  text-align:left;
}
.org-stat-row .badge{
  margin-left:0;
  flex-shrink:0;
  min-width:28px;
  justify-content:center;
}
.org-card-btn{
  display:block;
  width:100%;
  margin-top:18px;
  padding:12px 17px;
  text-align:center;
}
.org-card-delete-form{
  position:absolute;
  top:12px;
  right:12px;
  margin:0;
}
.org-card-delete{
  width:32px;
  height:32px;
  border:1px solid #f5c6cb;
  border-radius:9px;
  background:#fff5f6;
  color:var(--red);
  font-size:14px;
  cursor:pointer;
  transition:background .15s,border-color .15s,color .15s;
}
.org-card-delete:hover{
  background:var(--red);
  color:#fff;
  border-color:var(--red);
}
@media(max-width:1100px){
  .orgs{grid-template-columns:1fr}
}

/* Users & permissions */
.data-table{width:100%;border-collapse:collapse;font-size:14px}
.data-table th,.data-table td{padding:12px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.data-table th{font-size:12px;text-transform:uppercase;color:var(--muted);letter-spacing:.4px}
.data-table tbody tr:hover{background:#f7fbff}
.row-actions{display:flex;gap:8px;justify-content:flex-end;white-space:nowrap}
.btn.sm{padding:6px 12px;font-size:13px}
.recycle-row-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.recycle-row-actions form{margin:0;display:inline-flex}
.recycle-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border-radius:9px;font-size:12px;font-weight:600;font-family:inherit;cursor:pointer;border:1px solid transparent;transition:background .15s,color .15s,border-color .15s,box-shadow .15s;line-height:1.2;white-space:nowrap;-webkit-appearance:none;appearance:none;background:#fff;color:#52667d}
.recycle-btn svg{width:14px;height:14px;flex-shrink:0;display:block}
.recycle-btn--restore{color:#1f8a62;background:#f0faf6;border-color:#b8e6d4}
.recycle-btn--restore:hover{background:var(--green);color:#fff;border-color:var(--green);box-shadow:0 3px 10px rgba(39,174,126,.22)}
.recycle-btn--purge{color:#c0394a;background:#fff5f6;border-color:#f5c6cb}
.recycle-btn--purge:hover{background:var(--red);color:#fff;border-color:var(--red);box-shadow:0 3px 10px rgba(230,75,93,.22)}
.recycle-block-hint{display:block;margin-top:5px;font-size:11px;color:var(--muted);max-width:200px;line-height:1.35}
.status-ok{color:var(--green);font-weight:600}
.status-off{color:var(--red);font-weight:600}
.checkbox-inline{display:flex;align-items:center;gap:8px;font-weight:600}
.permissions-matrix-wrap{overflow-x:auto}
.permissions-matrix{width:100%;border-collapse:collapse;font-size:14px}
.permissions-matrix th,.permissions-matrix td{padding:10px 12px;border:1px solid var(--line);text-align:center}
.permissions-matrix th{background:#f4f8fc;font-size:12px;color:var(--muted)}
.permissions-matrix__head-row th{vertical-align:bottom;padding-bottom:6px}
.permissions-matrix__bulk-row th{background:#eef4fb;padding:6px 8px 10px;vertical-align:top}
.permissions-matrix__bulk-cell{text-align:center}
.perm-bulk-actions{display:flex;flex-direction:column;gap:4px;align-items:center}
.perm-bulk-btn{
  border:0;
  background:transparent;
  color:var(--blue);
  font-size:11px;
  font-weight:700;
  font-family:inherit;
  cursor:pointer;
  padding:2px 4px;
  border-radius:6px;
  line-height:1.3;
  white-space:nowrap;
}
.perm-bulk-btn:hover{background:#e9f5ff}
.perm-bulk-btn[data-perm-value="0"]{color:var(--muted)}
.perm-bulk-btn[data-perm-value="0"]:hover{color:var(--red);background:#fff5f6}
.permissions-matrix td:first-child,.permissions-matrix th:first-child{text-align:left;min-width:180px}
.perm-cell label{display:flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;margin:0}
.perm-cell input[type=checkbox]{width:16px;height:16px;cursor:pointer}
.permissions-global-panel{margin-top:16px;background:linear-gradient(180deg,#fff,#f8fbff)!important;border:1px solid #d7e6f5!important}
.permissions-org-panel{margin-top:16px}
.permissions-org-switcher{margin-top:16px;padding:16px 20px!important}
.permissions-org-switcher__label{display:block;margin-bottom:10px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.permissions-org-switcher__tags{display:flex;gap:8px;flex-wrap:wrap}
.permissions-section-head{margin-bottom:16px}
.permissions-section-head h2{margin:0 0 6px;font-size:18px;font-weight:800;color:var(--text)}
.permissions-section-head p{margin:0;font-size:13px;color:var(--muted);line-height:1.5}
.permissions-form-actions{display:flex;justify-content:flex-end;margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.permissions-matrix--global tbody tr{background:#fafcff}
.permissions-matrix--global tbody tr:hover{background:#f4faff}
.user-memberships-panel{margin-top:16px;padding:22px 24px!important}
.user-memberships-head{margin-bottom:18px}
.user-memberships-head h3{margin:0 0 6px;font-size:18px;font-weight:800;color:var(--text)}
.user-memberships-head p{margin:0;font-size:13px;color:var(--muted);line-height:1.5}
.user-membership-add{
  margin-bottom:18px;
  padding:16px 18px;
  border:1px solid #d7e6f5;
  border-radius:16px;
  background:linear-gradient(180deg,#fff,#f8fbff);
  box-shadow:0 8px 24px rgba(13,27,50,.05);
}
.user-membership-add__label{
  display:block;
  margin-bottom:10px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--muted);
}
.user-membership-add__row{display:flex;gap:12px;align-items:center}
.user-membership-add__field{flex:1;min-width:0}
.user-membership-add__field select{
  width:100%;
  min-height:46px;
  padding:10px 14px;
  border:1px solid #c9dcf0;
  border-radius:12px;
  background:#fff;
  font-size:14px;
  font-weight:600;
  color:var(--text);
  transition:border-color .15s,box-shadow .15s;
}
.user-membership-add__field select:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(13,141,242,.12);
}
.user-membership-add__btn{
  flex-shrink:0;
  min-height:46px;
  padding:0 20px;
  border-radius:12px;
  box-shadow:0 8px 20px rgba(39,174,126,.2);
}
.user-membership-limit-note{
  margin:0 0 18px;
  padding:12px 14px;
  border-radius:12px;
  background:#fafcff;
  border:1px solid var(--line);
  font-size:13px;
  color:var(--muted);
}
.user-membership-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:10px;
}
.user-membership-item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbff;
  transition:border-color .15s,background .15s,box-shadow .15s;
}
.user-membership-item:hover{
  border-color:#b8d4f0;
  background:#f4faff;
  box-shadow:0 6px 18px rgba(13,141,242,.08);
}
.user-membership-item__icon{
  width:42px;
  height:42px;
  border-radius:12px;
  background:linear-gradient(135deg,#e9f5ff,#f0faff);
  display:grid;
  place-items:center;
  font-size:18px;
  flex-shrink:0;
}
.user-membership-item__body{min-width:0;flex:1}
.user-membership-item__name{
  display:block;
  font-size:14px;
  line-height:1.4;
  color:var(--text);
  word-break:break-word;
}
.user-membership-item__action{flex-shrink:0;white-space:nowrap}
.user-membership-empty{
  text-align:center;
  padding:32px 18px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:#fafcff;
  color:var(--muted);
}
.user-membership-empty span{font-size:32px;display:block;margin-bottom:10px}
.user-membership-empty p{margin:0;font-size:14px;line-height:1.5}
@media(max-width:720px){
  .user-membership-add__row{flex-direction:column;align-items:stretch}
  .user-membership-add__btn{width:100%}
  .user-membership-item{align-items:flex-start;flex-wrap:wrap}
  .user-membership-item__action{width:100%;justify-content:center;text-align:center}
}
.login-page{min-height:100vh;display:grid;place-items:center;padding:24px}
.login-card{max-width:720px;width:100%}

/* Archive tree filters */
.tree-toolbar{margin-bottom:16px}
.tree-toolbar .searchbox{margin-bottom:12px}
.tree-filters{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end}
.tree-filter{display:flex;flex-direction:column;gap:6px;flex:1 1 140px;min-width:0}
.tree-filter span{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
.tree-filter select{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  font-size:14px;
  color:var(--text);
}
.tree-filter select:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(13,141,242,.12)}
.tree-filter-clear{
  align-self:flex-end;
  padding:10px 12px;
  border-radius:11px;
  background:#edf4fb;
  color:#52667d;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
.tree-filter-clear:hover{background:#dbe8f5;color:#223650}
.tree-filter-note{margin:10px 0 0;font-size:12px;color:var(--muted);line-height:1.4}

/* Profile page */
.profile-page{margin-top:-8px}
.profile-hero{
  background:linear-gradient(135deg,#0d1b32 0%,#0d8df2 55%,#23c7e8 100%);
  border-radius:20px;
  padding:32px 28px;
  margin-bottom:22px;
  box-shadow:0 16px 48px rgba(13,141,242,.22);
  color:#fff;
}
.profile-hero-inner{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.profile-avatar{
  width:84px;
  height:84px;
  border-radius:50%;
  background:rgba(255,255,255,.18);
  border:3px solid rgba(255,255,255,.35);
  display:grid;
  place-items:center;
  font-size:28px;
  font-weight:800;
  letter-spacing:.5px;
  flex-shrink:0;
  backdrop-filter:blur(8px);
}
.profile-hero-text{min-width:0}
.profile-name{margin:0 0 6px;font-size:26px;font-weight:800;line-height:1.25}
.profile-meta{margin:0;font-size:14px;color:rgba(255,255,255,.82);line-height:1.5}
.profile-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,340px);
  gap:20px;
  align-items:start;
}
.profile-section-head{margin-bottom:20px}
.profile-section-head h2{margin:0 0 6px;font-size:18px;font-weight:800;color:var(--text)}
.profile-section-head p{margin:0;font-size:13px;color:var(--muted);line-height:1.5}
.profile-form .field input:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(13,141,242,.12);
}
.profile-form-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--line);
}
.profile-form-actions .btn{display:inline-flex;align-items:center;gap:8px}
.btn-icon{font-size:15px;line-height:1}
.profile-aside{display:grid;gap:16px;min-width:0}
.profile-org-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.profile-org-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbff;
  transition:border-color .15s,background .15s;
}
.profile-org-item:hover{border-color:#b8d4f0;background:#f4faff}
.profile-org-icon{
  width:40px;
  height:40px;
  border-radius:12px;
  background:linear-gradient(135deg,#e9f5ff,#f0faff);
  display:grid;
  place-items:center;
  font-size:18px;
  flex-shrink:0;
}
.profile-org-body{min-width:0;flex:1}
.profile-org-body strong{
  display:block;
  font-size:14px;
  line-height:1.4;
  color:var(--text);
  margin-bottom:6px;
  word-break:break-word;
}
.profile-role-badge{
  display:inline-flex;
  padding:3px 10px;
  border-radius:999px;
  background:#e9f5ff;
  color:var(--blue);
  font-size:12px;
  font-weight:700;
}
.profile-empty-orgs{
  text-align:center;
  padding:28px 16px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:#fafcff;
  color:var(--muted);
}
.profile-empty-orgs span{font-size:32px;display:block;margin-bottom:10px}
.profile-empty-orgs p{margin:0;font-size:14px;line-height:1.5}
.profile-info-panel{padding:18px 20px!important}
.profile-info-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.profile-info-row:last-child{border-bottom:0;padding-bottom:0}
.profile-info-row:first-child{padding-top:0}
.profile-info-row small{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
.profile-info-row strong{font-size:14px;color:var(--text);text-align:right}
.profile-status-super{color:var(--blue)!important}
@media(max-width:960px){
  .profile-layout{grid-template-columns:1fr}
  .profile-hero{padding:24px 20px}
  .profile-name{font-size:22px}
}
@media(max-width:720px){
  .profile-form-actions{flex-direction:column-reverse;align-items:stretch}
  .profile-form-actions .btn{width:100%;justify-content:center;text-align:center}
}
.upload-chart-panel{padding-bottom:18px!important;overflow:visible!important}
.ea-filter-bar{margin-bottom:16px;padding:14px 16px 16px;border:1px solid #d7e6f5;border-radius:16px;background:#fff;box-shadow:0 8px 28px rgba(13,27,50,.06)}
.ea-filter-bar__row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:12px;align-items:end}
.ea-dropdown{position:relative;min-width:0}
.ea-dropdown>summary{list-style:none;cursor:pointer;user-select:none;display:grid;grid-template-columns:1fr 32px;grid-template-rows:auto auto;gap:2px 8px;align-items:center;min-height:54px;padding:9px 12px 9px 14px;border:1px solid #c9dcf0;border-radius:14px;background:linear-gradient(180deg,#fff,#f8fbff);transition:border-color .15s,box-shadow .15s}
.ea-dropdown>summary::-webkit-details-marker{display:none}
.ea-dropdown>summary::marker{content:""}
.ea-dropdown>summary:hover{border-color:#9ec9ef;box-shadow:0 4px 16px rgba(13,141,242,.08)}
.ea-dropdown[open]>summary{border-color:#0d8df2;box-shadow:0 0 0 4px rgba(13,141,242,.12);background:#fff}
.ea-dropdown__label{grid-column:1;grid-row:1;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:#718096}
.ea-dropdown__value{grid-column:1;grid-row:2;font-size:14px;font-weight:700;color:#172033;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ea-dropdown__icon{grid-column:2;grid-row:1 / span 2;width:32px;height:32px;border-radius:10px;background:#edf5ff;position:relative}
.ea-dropdown__icon::before{content:"";position:absolute;inset:0;margin:auto;width:8px;height:8px;border-right:2px solid #4d6b8a;border-bottom:2px solid #4d6b8a;transform:rotate(45deg) translate(-1px,-2px);transition:transform .15s}
.ea-dropdown[open] .ea-dropdown__icon::before{transform:rotate(-135deg) translate(-1px,1px)}
.ea-dropdown__menu{position:absolute;z-index:200;top:calc(100% + 8px);left:0;right:0;margin:0;padding:6px;list-style:none;border:1px solid #d7e6f5;border-radius:14px;background:#fff;box-shadow:0 18px 44px rgba(13,27,50,.16);max-height:280px;overflow:auto}
.ea-dropdown__option{display:block;width:100%;padding:11px 12px;border:0;border-radius:10px;background:transparent;color:#33506c;font-size:14px;font-weight:600;font-family:inherit;text-align:left;cursor:pointer}
.ea-dropdown__option:hover{background:#f4faff;color:#0d8df2}
.ea-dropdown__option.is-active{background:linear-gradient(135deg,#0d8df2,#23c7e8);color:#fff}
.ea-combobox{position:relative;min-width:0}
.ea-combobox__input{width:100%;min-height:48px;padding:10px 14px;border:1px solid #c9dcf0;border-radius:14px;background:#fff;font-family:inherit;font-size:14px;font-weight:600;color:#172033;transition:border-color .15s,box-shadow .15s}
.ea-combobox__input:hover{border-color:#9ec9ef;box-shadow:0 4px 16px rgba(13,141,242,.08)}
.ea-combobox__input:focus{outline:none;border-color:#0d8df2;box-shadow:0 0 0 4px rgba(13,141,242,.12)}
.ea-combobox.is-open .ea-combobox__input{border-color:#0d8df2;box-shadow:0 0 0 4px rgba(13,141,242,.12)}
.ea-combobox__menu{position:absolute;z-index:200;top:calc(100% + 8px);left:0;right:0;margin:0;padding:6px;border:1px solid #d7e6f5;border-radius:14px;background:#fff;box-shadow:0 18px 44px rgba(13,27,50,.16);max-height:280px;overflow:auto}
.ea-combobox__option{display:block;width:100%;padding:11px 12px;border:0;border-radius:10px;background:transparent;color:#33506c;font-size:14px;font-weight:600;font-family:inherit;text-align:left;cursor:pointer}
.ea-combobox__option:hover{background:#f4faff;color:#0d8df2}
.ea-combobox__option.is-active{background:linear-gradient(135deg,#0d8df2,#23c7e8);color:#fff}
.ea-combobox__option[hidden]{display:none}
.ea-combobox__empty{margin:0;padding:11px 12px;font-size:13px;font-weight:600;color:#718096;text-align:center}
.ea-filter-bar__actions{display:flex;gap:8px;align-items:center}
.ea-filter-btn{display:inline-flex;align-items:center;justify-content:center;min-height:54px;padding:0 18px;border-radius:14px;font-size:13px;font-weight:700;font-family:inherit;text-decoration:none;cursor:pointer;border:0;white-space:nowrap}
.ea-filter-btn--ghost{background:#fff;color:#33506c;border:1px solid #c9dcf0}
.ea-filter-btn--ghost:hover{background:#f4faff;color:#0d8df2}
.ea-filter-btn--primary{background:linear-gradient(135deg,#0d8df2,#12a8ff);color:#fff;box-shadow:0 8px 20px rgba(13,141,242,.22)}
.ea-filter-btn--apply{display:none}
.ea-filter-bar.is-custom .ea-filter-btn--apply{display:inline-flex}
.ea-filter-dates{display:none;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px;padding-top:14px;border-top:1px solid #e8f0f8}
.ea-filter-bar.is-custom .ea-filter-dates{display:grid}
.ea-field label{display:block;margin-bottom:7px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#718096}
.ea-field input[type="date"]{width:100%;min-height:48px;padding:10px 14px;border:1px solid #c9dcf0;border-radius:14px;background:#fff;font-family:inherit;font-size:14px;font-weight:600;color:#172033}
.ea-field input[type="date"]:focus{outline:none;border-color:#0d8df2;box-shadow:0 0 0 4px rgba(13,141,242,.12)}
.ea-filter-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #eef4fb}
.ea-filter-tag{padding:5px 12px;border-radius:999px;background:#edf4fb;color:#33506c;font-size:12px;font-weight:700}
.ea-filter-tag--blue{background:rgba(13,141,242,.12);color:#0d8df2}
@media(max-width:900px){.ea-filter-bar__row{grid-template-columns:1fr}.ea-filter-bar__actions{justify-content:stretch}.ea-filter-btn{flex:1}.ea-filter-dates{grid-template-columns:1fr}}
.dashboard.dashboard-charts{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,360px);
  gap:18px;
  margin-top:18px;
  align-items:start;
}
.chart-header{margin-bottom:14px}
.chart-filters{
  margin-bottom:16px;
  padding:14px 16px 16px;
  border:1px solid rgba(13,141,242,.1);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 24px rgba(13,27,50,.04);
}
.chart-filters__toolbar{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr)) auto;
  gap:12px;
  align-items:end;
}
.filter-field{
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0;
}
.filter-field__label{
  font-size:12px;
  font-weight:700;
  color:#52667d;
  letter-spacing:.01em;
}
.filter-control{
  position:relative;
}
.filter-control select,
.custom-range__field input[type="date"],
.filter-action{
  font-family:inherit;
  -webkit-appearance:none;
  appearance:none;
}
.filter-control select,
.custom-range__field input[type="date"]{
  width:100%;
  border:1px solid #cfddee;
  border-radius:12px;
  padding:11px 40px 11px 14px;
  font-size:14px;
  font-weight:600;
  color:var(--text);
  background:#f8fbff;
  transition:border-color .15s, box-shadow .15s, background .15s;
  cursor:pointer;
}
.filter-control select:hover,
.custom-range__field input[type="date"]:hover{
  border-color:#9ec9ef;
  background:#fff;
}
.filter-control::after{
  content:"";
  position:absolute;
  top:50%;
  right:16px;
  width:7px;
  height:7px;
  border-right:2px solid #6b84a3;
  border-bottom:2px solid #6b84a3;
  transform:translateY(-70%) rotate(45deg);
  pointer-events:none;
}
.filter-control select:focus,
.custom-range__field input[type="date"]:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(13,141,242,.12);
  background:#fff;
}
.chart-filters__actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.filter-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 16px;
  border-radius:12px;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
  border:0;
  cursor:pointer;
  transition:transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.filter-action--ghost{
  background:#fff;
  color:#33506c;
  border:1px solid #cfddee;
}
.filter-action--ghost:hover{
  background:#f4faff;
  border-color:#9ec9ef;
  color:var(--blue);
}
.filter-action--primary{
  background:linear-gradient(135deg,var(--blue),#12a8ff);
  color:#fff;
  box-shadow:0 6px 16px rgba(13,141,242,.22);
}
.filter-action--primary:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(13,141,242,.28);
}
.chart-filters__custom{
  display:none;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e8f0f8;
}
.chart-filters.is-custom .chart-filters__custom{display:block}
.chart-filters.is-custom .chart-filter--custom.filter-action--primary{display:inline-flex}
.chart-filter--custom{display:none}
.custom-range{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  align-items:end;
}
.custom-range__field{
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0;
}
.custom-range__field span{
  font-size:12px;
  font-weight:700;
  color:#52667d;
}
.custom-range__field input[type="date"]{
  padding-right:14px;
  cursor:text;
}
.custom-range__divider{display:none}
.filter-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #eef4fb;
}
.filter-chip{
  display:inline-flex;
  align-items:center;
  padding:5px 11px;
  border-radius:999px;
  background:#edf4fb;
  color:#33506c;
  font-size:12px;
  font-weight:700;
}
.filter-chip--accent{
  background:rgba(13,141,242,.1);
  color:var(--blue);
}
.chart-subtitle{margin:6px 0 0;font-size:13px;line-height:1.5;color:var(--muted)}
.chart-meta{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:10px;
  margin-bottom:14px;
}
.chart-meta-item{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fbff;
  min-width:0;
}
.chart-meta-item small{
  display:block;
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.03em;
  margin-bottom:4px;
}
.chart-meta-item strong{
  display:block;
  font-size:14px;
  color:var(--text);
  line-height:1.35;
  word-break:break-word;
}
.chart-empty{
  min-height:260px;
  display:grid;
  place-items:center;
  text-align:center;
  padding:28px 20px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:#fafcff;
  color:var(--muted);
}
.chart-empty span{font-size:34px;display:block;margin-bottom:10px}
.chart-empty p{margin:0;max-width:520px;font-size:14px;line-height:1.6}
.chart-canvas-wrap{
  position:relative;
  width:100%;
  height:min(340px,52vw);
  min-height:260px;
  padding:8px 4px 0;
}
.chart-canvas-wrap--donut{
  height:min(380px,58vw);
  min-height:300px;
}
.chart-canvas-wrap canvas{display:block;width:100%!important;height:100%!important}
.chart-footnote{
  margin:10px 4px 0;
  font-size:12px;
  line-height:1.5;
  color:var(--muted);
}
.size-chart-panel{padding-bottom:18px!important}
@media(max-width:1100px){
  .dashboard.dashboard-charts{grid-template-columns:1fr}
  .chart-canvas-wrap{height:300px}
  .chart-canvas-wrap--donut{height:340px}
  .chart-filters__toolbar{grid-template-columns:1fr;align-items:stretch}
  .chart-filters__actions{justify-content:flex-start}
}
@media(max-width:720px){
  .chart-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chart-canvas-wrap{height:260px;min-height:220px}
  .chart-canvas-wrap--donut{height:300px;min-height:260px}
  .chart-filters{padding:12px}
  .chart-filters__toolbar{grid-template-columns:1fr;align-items:stretch}
  .chart-filters__actions{justify-content:stretch}
  .filter-action{flex:1}
  .custom-range{grid-template-columns:1fr}
}
.upload-stats-section{margin-top:24px}
.upload-stats-panel{padding:18px 20px 20px}
.upload-stats-filters .upload-stats-filter-row{
  grid-template-columns:minmax(150px,.95fr) minmax(0,1.35fr) minmax(130px,.75fr) minmax(130px,.75fr) auto;
  gap:10px;
  align-items:end;
}
.upload-stats-filters .upload-stats-filter-row--org{
  grid-template-columns:minmax(140px,.85fr) minmax(0,1.2fr) minmax(120px,.7fr) minmax(120px,.7fr) minmax(140px,.85fr) auto;
}
.upload-stats-search-field{min-width:0}
.upload-stats-filters .upload-stats-search-input,
.upload-stats-filters .ea-field input[type="date"]{
  width:100%;
  min-height:54px;
  padding:10px 14px 10px 42px;
  border:1px solid #c9dcf0;
  border-radius:14px;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234d6b8a' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") 14px center no-repeat;
  font-family:inherit;
  font-size:14px;
  font-weight:600;
  color:#172033;
  box-shadow:none;
  transition:border-color .15s,box-shadow .15s;
}
.upload-stats-filters .upload-stats-search-input::placeholder{color:#94a6ba;font-weight:600}
.upload-stats-filters .upload-stats-search-input:hover,
.upload-stats-filters .ea-field input[type="date"]:hover{border-color:#9ec9ef;box-shadow:0 4px 16px rgba(13,141,242,.08)}
.upload-stats-filters .upload-stats-search-input:focus,
.upload-stats-filters .ea-field input[type="date"]:focus{
  outline:none;
  border-color:#0d8df2;
  box-shadow:0 0 0 4px rgba(13,141,242,.12);
}
.upload-stats-filters .ea-field input[type="date"]{
  padding:10px 14px;
  background:#fff;
}
.upload-stats-search-hint{
  margin:10px 0 0;
  font-size:12px;
  line-height:1.45;
  color:#718096;
}
.upload-stats-actions{align-self:end}
.upload-stats-meta{margin-bottom:14px}
.upload-stats-output{transition:opacity .15s ease}
.upload-stats-output--loading{opacity:.55;pointer-events:none}
.upload-stats-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px}
.upload-stats-table{margin:0}
.upload-stats-table th,.upload-stats-table td{white-space:nowrap}
@media(max-width:1100px){
  .upload-stats-filters .upload-stats-filter-row,
  .upload-stats-filters .upload-stats-filter-row--org{
    grid-template-columns:1fr 1fr;
  }
  .upload-stats-actions{grid-column:1 / -1;justify-content:stretch}
  .upload-stats-actions .ea-filter-btn{flex:1}
}
@media(max-width:700px){
  .upload-stats-filters .upload-stats-filter-row,
  .upload-stats-filters .upload-stats-filter-row--org{
    grid-template-columns:1fr;
  }
}

.reports-filter-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr) auto;
  gap:14px;
  align-items:end;
}
.reports-filter-bar{margin-bottom:0;padding:0;border:0;background:transparent;box-shadow:none}
.reports-filter-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.35fr) minmax(0,1fr) minmax(0,1fr) auto;
  gap:12px;
  align-items:end;
}
.reports-filter-actions{margin-top:0}
.reports-filter-bar .ea-field input[type="date"]{
  width:100%;
  min-height:54px;
  padding:10px 14px;
  border:1px solid #c9dcf0;
  border-radius:14px;
  background:#fff;
  font-family:inherit;
  font-size:14px;
  font-weight:600;
  color:#172033;
}
.reports-filter-bar .ea-field input[type="date"]:hover{border-color:#9ec9ef;box-shadow:0 4px 16px rgba(13,141,242,.08)}
.reports-filter-bar .ea-field input[type="date"]:focus{outline:none;border-color:#0d8df2;box-shadow:0 0 0 4px rgba(13,141,242,.12)}
.report-detail-panel{margin-top:18px}
.report-detail-header{display:flex;align-items:flex-start;gap:14px;margin-bottom:16px}
.report-detail-header h3{margin:0 0 4px;font-size:18px}
.report-detail-subtitle{margin:0;color:var(--muted);font-size:13px}
.report-detail-meta{margin-bottom:14px}
.reports-filter-actions{margin-top:0;justify-content:flex-start}
.report-result .report-found{color:var(--green)}
.report-table-wrap{margin-top:14px;overflow:auto;border:1px solid var(--line);border-radius:14px}
.report-table{margin:0}
@media(max-width:1100px){
  .reports-filter-grid{grid-template-columns:1fr 1fr}
  .reports-filter-row{grid-template-columns:1fr 1fr}
  .reports-filter-actions{grid-column:1 / -1}
}
@media(max-width:700px){
  .reports-filter-grid{grid-template-columns:1fr}
  .reports-filter-row{grid-template-columns:1fr}
}

/* Error pages */
.error-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:linear-gradient(135deg,#06182f 0%,#0a7fde 100%);
}
.error-card{
  width:min(480px,100%);
  background:#fff;
  border-radius:24px;
  padding:36px 32px 28px;
  box-shadow:0 30px 90px rgba(0,0,0,.25);
  text-align:center;
}
.error-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-bottom:24px;
  color:#52667d;
  font-size:14px;
  font-weight:700;
}
.error-brand .mark{
  width:42px;
  height:42px;
  border-radius:13px;
  font-size:15px;
}
.error-code{
  font-size:72px;
  font-weight:800;
  line-height:1;
  background:linear-gradient(135deg,var(--blue),var(--cyan));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  margin-bottom:8px;
}
.error-card h1{
  margin:0 0 12px;
  font-size:24px;
  font-weight:800;
  color:var(--text);
}
.error-message{
  margin:0 0 24px;
  color:var(--muted);
  font-size:15px;
  line-height:1.6;
}
.error-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin-bottom:20px;
}
.error-actions .btn{
  min-width:140px;
}
.error-footnote{
  margin:0;
  font-size:12px;
  color:#94a6ba;
}
@media(max-width:480px){
  .error-card{padding:28px 20px 22px}
  .error-code{font-size:56px}
  .error-actions{flex-direction:column}
  .error-actions .btn{width:100%}
}

/* Saxlama vahidi redaktə modalı */
.unit-edit-modal .modal-box{
  width:min(920px,calc(100% - 32px));
  max-height:calc(100vh - 44px);
  overflow-y:auto;
  padding:22px 24px 20px;
}
.unit-edit-modal .modal-head{
  margin-bottom:18px;
  padding-bottom:14px;
}
.unit-edit-modal .modal-head h2{
  margin:0;
  font-size:18px;
  font-weight:800;
  color:var(--text);
}
.unit-edit-modal .form-grid{
  grid-template-columns:repeat(3,1fr);
  gap:16px 14px;
}
.unit-edit-modal .field.w-full{
  grid-column:1/-1;
}
.unit-edit-modal .field textarea{
  min-height:88px;
  resize:vertical;
}
.unit-edit-modal .actions{
  margin-top:20px;
  padding-top:4px;
}
@media(max-width:720px){
  .unit-edit-modal .form-grid{grid-template-columns:1fr}
  .unit-edit-modal .field.w-full{grid-column:auto}
}

.retention-period-custom{
  margin-top:10px;
}
.retention-period-custom[hidden]{
  display:none;
}
