:root{
  --bg:#f3f7f5;--panel:#fff;--panel2:#f8fbfa;--ink:#13241f;--text:#20332d;--muted:#6b7b76;
  --line:#dbe6e2;--line2:#e7efec;--green:#176f5c;--green2:#23866e;--green3:#dff3eb;
  --warn:#b7791f;--warnbg:#fff6df;--danger:#a83f4d;--dangerbg:#fff0f2;--shadow:0 18px 50px rgba(25,57,48,.09);
  --radius:18px;--radius-sm:12px;--max:1260px;
}
*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}body{margin:0;min-height:100vh;background:linear-gradient(180deg,#eef6f2 0,#f8faf9 42%,#f3f7f5 100%);color:var(--text)}a{color:inherit}button,input,select,textarea{font:inherit}.muted{color:var(--muted)}code{background:#eef4f1;padding:2px 6px;border-radius:7px}.span-all{grid-column:1/-1}

.brand{display:flex;align-items:center;gap:11px;text-decoration:none}.brand span:not(.brand-mark){display:grid;line-height:1.15}.brand b{font-size:17px;letter-spacing:-.3px;color:var(--ink)}.brand small{font-size:10px;color:var(--muted);margin-top:3px}.brand-large b{font-size:20px}.brand-large small{font-size:11px}.brand-mark{position:relative;display:grid;grid-template-columns:repeat(3,5px);align-items:end;gap:3px;width:34px;height:34px;padding:7px;border-radius:11px;background:linear-gradient(145deg,var(--green),#114c40);box-shadow:0 8px 18px rgba(23,111,92,.22)}.brand-mark>span{display:block;width:5px;border-radius:999px;background:#fff}.brand-mark>span:nth-child(1){height:9px;opacity:.72}.brand-mark>span:nth-child(2){height:17px}.brand-mark>span:nth-child(3){height:13px;opacity:.84}
.eyebrow{display:block;font-size:10px;font-weight:900;letter-spacing:.16em;color:var(--green);text-transform:uppercase}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:11px;padding:11px 15px;border:1px solid transparent;text-decoration:none;font-weight:850;font-size:13px;cursor:pointer;transition:.16s ease;background:#fff;color:var(--ink)}.btn:hover{transform:translateY(-1px)}.btn-primary{background:var(--green);border-color:var(--green);color:#fff;box-shadow:0 8px 20px rgba(23,111,92,.14)}.btn-primary:hover{background:var(--green2)}.btn-ghost{border-color:var(--line);background:#fff}.btn-danger{background:var(--danger);color:#fff}.btn-wide{width:100%;min-height:46px}.btn-small{padding:8px 10px;font-size:12px}.icon-btn{width:38px;height:38px;border-radius:11px;border:1px solid var(--line);display:grid;place-items:center;text-decoration:none;background:#fff;color:var(--muted);font-weight:900}

.flash{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:0 0 14px;font-size:13px;line-height:1.45}.flash-success{background:#eaf7f1;border-color:#c8e8dc;color:#1b6755}.flash-error{background:var(--dangerbg);border-color:#f0c7cd;color:#8b3340}.flash-warning{background:var(--warnbg);border-color:#ecd89e;color:#7c5b15}.flash-info{background:#edf4f7;border-color:#d2e2e9;color:#425d68}

/* Auth */
.auth-page{display:grid;place-items:center;padding:28px;min-height:100vh;background:radial-gradient(circle at 12% 12%,#d8eee5 0,transparent 36%),radial-gradient(circle at 88% 80%,#dfeeea 0,transparent 30%),#edf4f1}.auth-shell{width:min(1040px,100%);display:grid;grid-template-columns:1.05fr .95fr;border:1px solid rgba(208,224,218,.9);border-radius:28px;overflow:hidden;background:rgba(255,255,255,.88);box-shadow:0 28px 90px rgba(26,62,52,.14);backdrop-filter:blur(18px)}.auth-shell.single{grid-template-columns:1fr;max-width:620px}.auth-brand{min-height:620px;padding:38px;display:flex;flex-direction:column;justify-content:space-between;background:linear-gradient(155deg,#eff8f4,#dceee7);position:relative;overflow:hidden}.auth-brand:after{content:"";position:absolute;right:-95px;bottom:-95px;width:310px;height:310px;border-radius:50%;border:55px solid rgba(23,111,92,.06)}.auth-copy{position:relative;z-index:1;max-width:500px}.auth-copy h1{font-size:clamp(38px,5vw,62px);line-height:.98;letter-spacing:-2.8px;margin:14px 0 18px;color:var(--ink)}.auth-copy>p{font-size:16px;line-height:1.65;color:#536b63;max-width:460px}.security-points{display:grid;gap:9px;margin-top:28px}.security-points span{font-size:12px;font-weight:750;color:#3d6258;background:rgba(255,255,255,.65);border:1px solid rgba(190,216,206,.9);border-radius:11px;padding:10px 12px}.auth-card{padding:50px 46px;display:flex;justify-content:center;flex-direction:column;background:#fff}.auth-card h2{font-size:28px;letter-spacing:-1px;margin:8px 0 8px}.auth-form{display:grid;gap:15px}.auth-form label,.meta-form label,.filter-grid label,.modal label{display:grid;gap:6px}.auth-form label>span,.meta-form label>span,.filter-grid label>span,.modal label>span{font-size:11px;font-weight:850;color:#52645e}.auth-form input,.meta-form input,.meta-form select,.meta-form textarea,.filter-grid input,.filter-grid select,.modal input{width:100%;border:1px solid #cad9d4;background:#fbfdfc;border-radius:11px;padding:12px 13px;color:var(--ink);outline:none;transition:.15s}.auth-form input:focus,.meta-form input:focus,.meta-form select:focus,.meta-form textarea:focus,.filter-grid input:focus,.filter-grid select:focus,.modal input:focus{border-color:#68a996;box-shadow:0 0 0 3px rgba(45,137,112,.09);background:#fff}.form-note{font-size:12px;color:var(--muted);line-height:1.55;margin:2px 0 0}.sent-state{text-align:center}.mail-illustration{width:66px;height:66px;display:grid;place-items:center;margin:0 auto 22px;border-radius:20px;background:var(--green3);color:var(--green);font-size:28px}.sent-state p{color:var(--muted);line-height:1.55}.sent-state ol{text-align:left;display:grid;gap:10px;margin:22px 0;padding:18px 18px 18px 38px;border:1px solid var(--line);border-radius:13px;background:var(--panel2);font-size:13px}.setup-card{min-height:420px}.setup-card h1{font-size:42px;letter-spacing:-2px;margin:10px 0}.setup-card p{line-height:1.6}.setup-list{display:grid;gap:5px;padding:15px;border:1px solid var(--line);background:var(--panel2);border-radius:12px;margin:14px 0}.setup-list span{color:var(--muted)}

/* App shell */
.topbar{position:sticky;top:0;z-index:100;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:24px;min-height:70px;padding:0 max(22px,calc((100vw - var(--max))/2));background:rgba(248,251,250,.92);backdrop-filter:blur(18px);border-bottom:1px solid rgba(215,229,223,.9)}.topnav{display:flex;justify-content:center;gap:4px}.topnav a{padding:9px 12px;border-radius:10px;text-decoration:none;font-size:12px;font-weight:800;color:#62746e}.topnav a:hover,.topnav a.active{background:#e4f2ed;color:var(--green)}.user-menu{display:flex;align-items:center;gap:10px}.user-menu>div{text-align:right;display:grid}.user-menu b{font-size:12px}.user-menu small{font-size:10px;color:var(--muted);max-width:180px;overflow:hidden;text-overflow:ellipsis}.app-shell{width:min(var(--max),calc(100% - 36px));margin:0 auto;padding:34px 0 60px}.page-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:20px}.page-head h1{font-size:clamp(28px,4vw,44px);line-height:1.05;letter-spacing:-1.8px;color:var(--ink);margin:6px 0}.page-head p{color:var(--muted);margin:0;line-height:1.5}.profile-banner{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;padding:21px;background:linear-gradient(135deg,#173f36,#1e6655);border-radius:20px;color:#fff;box-shadow:var(--shadow);margin-bottom:18px}.profile-avatar{width:52px;height:52px;display:grid;place-items:center;border-radius:16px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.16);font-size:21px;font-weight:900}.profile-banner span{font-size:10px;font-weight:850;letter-spacing:.09em;text-transform:uppercase;color:#bee2d6}.profile-banner h2{margin:3px 0 3px;font-size:24px;letter-spacing:-.8px}.profile-banner p{margin:0;color:#d3e8e1;font-size:12px}.profile-banner .btn{background:#fff;color:#184f42;border-color:#fff}
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}.stat-card{display:grid;gap:3px;padding:18px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.88);text-decoration:none;box-shadow:0 8px 26px rgba(25,57,48,.04);transition:.16s}.stat-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.stat-number{font-size:30px;font-weight:950;letter-spacing:-1.2px;color:var(--ink)}.stat-card b{font-size:13px}.stat-card small{font-size:11px;color:var(--muted)}
.section-card{background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:0 10px 32px rgba(25,57,48,.045);margin:0 0 18px}.section-head{display:flex;align-items:end;justify-content:space-between;gap:14px;margin-bottom:15px}.section-head h2{font-size:21px;letter-spacing:-.7px;margin:4px 0 0}.section-head>a{font-size:12px;font-weight:800;color:var(--green);text-decoration:none}.folder-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.folder-card{min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:13px;border:1px solid var(--line2);border-radius:13px;background:var(--panel2);text-decoration:none;transition:.15s}.folder-card:hover{background:#edf7f3;border-color:#cde4db;transform:translateY(-1px)}.folder-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#e2f2ec;color:var(--green);font-size:18px;font-weight:900}.folder-card div{min-width:0;display:grid}.folder-card b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folder-card small{font-size:10px;color:var(--muted);margin-top:3px}.chev{font-size:21px;color:#96a7a1}.folder-up{background:#fff}.toolbar{display:flex;gap:9px;flex-wrap:wrap;margin:0 0 14px}.breadcrumb{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin:0 0 14px}.breadcrumb a{text-decoration:none;font-weight:750}.breadcrumb a:hover{color:var(--green)}
.doc-list{display:grid;border-top:1px solid var(--line2)}.doc-list.spaced{margin-top:18px}.doc-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:12px 4px;border-bottom:1px solid var(--line2);text-decoration:none}.doc-row:hover .doc-main b{color:var(--green)}.file-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:11px;background:#eef4f2;border:1px solid #e0e9e6;font-size:9px;font-weight:950;color:#536a62;letter-spacing:.05em}.doc-main{min-width:0;display:grid}.doc-main b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:.15s}.doc-main small{font-size:10px;color:var(--muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status{display:inline-flex;align-items:center;justify-content:center;padding:5px 8px;border-radius:999px;font-size:9px;font-weight:900;white-space:nowrap}.status-inbox{background:#edf2f5;color:#526671}.status-review{background:#fff3d7;color:#88610e}.status-archived{background:#ddf3ea;color:#176654}.status-discard_review{background:#fde9ec;color:#90424e}.empty-state{min-height:130px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:5px;color:var(--muted);padding:24px}.empty-state b{color:var(--ink);font-size:13px}.empty-state span{font-size:11px;max-width:500px;line-height:1.5}

/* Search / forms */
.filter-card{padding:16px}.filter-grid{display:grid;grid-template-columns:2fr repeat(4,minmax(130px,1fr));gap:10px;align-items:end}.filter-search{grid-column:span 2}.filter-grid label{min-width:0}.filter-grid input,.filter-grid select{padding:10px 11px;font-size:12px}.filter-actions{display:flex;gap:8px;align-items:end}.upload-card{max-width:760px}.upload-form{display:grid;gap:13px}.drop-zone{min-height:300px;border:1.5px dashed #b8d2c9;border-radius:17px;background:#f7fbf9;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:7px;cursor:pointer;padding:30px;transition:.15s}.drop-zone:hover,.drop-zone.dragging{background:#edf8f4;border-color:#70a997}.drop-zone input{position:absolute;opacity:0;pointer-events:none}.drop-icon{width:52px;height:52px;display:grid;place-items:center;border-radius:16px;background:#e1f2ec;color:var(--green);font-size:26px}.drop-zone b{font-size:15px}.drop-zone small{font-size:11px;color:var(--muted)}

/* Document detail */
.detail-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(320px,.7fr);gap:18px;align-items:start;margin-bottom:18px}.preview-card,.meta-card{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:0 10px 32px rgba(25,57,48,.045)}.preview-toolbar{min-height:62px;padding:11px 13px;display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid var(--line);background:#fbfdfc}.preview-toolbar>div:first-child{display:grid;gap:5px}.preview-toolbar small{color:var(--muted);font-size:10px}.preview-toolbar>div:last-child{display:flex;gap:7px}.doc-preview{width:100%;height:min(75vh,900px);min-height:630px;border:0;background:#eef1f0}.image-preview{min-height:630px;display:grid;place-items:center;background:#edf2f0;padding:20px}.image-preview img{max-width:100%;max-height:75vh;object-fit:contain;box-shadow:0 9px 30px #0002}.meta-card{padding:18px;position:sticky;top:88px}.meta-form{display:grid;gap:11px}.meta-head h2{margin:3px 0 3px;font-size:22px}.meta-form input,.meta-form select,.meta-form textarea{padding:10px 11px;font-size:12px}.meta-form textarea{resize:vertical}.form-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.danger-zone{margin-top:13px;border-top:1px solid var(--line2);padding-top:11px}.danger-zone summary{cursor:pointer;font-size:11px;color:var(--muted);font-weight:800}.danger-zone form{margin-top:10px}.timeline{display:grid}.timeline-row{display:grid;grid-template-columns:16px 1fr;gap:9px;padding:9px 0}.timeline-row>span{width:8px;height:8px;background:#8faaa1;border-radius:50%;margin-top:4px;box-shadow:0 0 0 4px #eef4f1}.timeline-row div{display:grid}.timeline-row b{font-size:11px}.timeline-row small{font-size:9px;color:var(--muted);margin-top:2px}.timeline-row p{margin:4px 0 0;font-size:10px;color:var(--muted)}

/* Dialog */
.modal{width:min(460px,calc(100% - 28px));border:0;border-radius:18px;padding:0;box-shadow:0 30px 90px rgba(15,37,31,.28);color:var(--text)}.modal::backdrop{background:rgba(12,27,23,.47);backdrop-filter:blur(3px)}.modal form{padding:20px;display:grid;gap:14px}.modal-head{display:flex;align-items:start;justify-content:space-between;gap:12px}.modal-head h3{margin:4px 0 0;font-size:21px}.modal-close{border:0;background:#eef3f1;width:34px;height:34px;border-radius:10px;cursor:pointer;font-size:20px;color:var(--muted)}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}

/* Print */
.print-page{background:#dfe5e3}.printbar{position:sticky;top:0;z-index:5;min-height:66px;display:flex;justify-content:space-between;align-items:center;gap:15px;padding:10px 18px;background:#fff;border-bottom:1px solid #d6e0dc}.printbar>div{display:grid}.printbar b{font-size:13px}.printbar small{font-size:10px;color:var(--muted);margin-top:3px}.print-content{height:calc(100vh - 66px);display:grid;place-items:center;padding:12px}.print-content iframe{width:100%;height:100%;border:0;background:#fff}.print-content img{max-width:100%;max-height:100%;object-fit:contain;background:#fff;box-shadow:0 8px 30px #0002}@media print{.printbar{display:none}.print-content{height:100vh;padding:0;background:#fff}.print-content iframe{height:100vh}}

@media(max-width:1050px){.folder-grid{grid-template-columns:repeat(3,1fr)}.filter-grid{grid-template-columns:repeat(4,1fr)}.filter-search{grid-column:span 2}.detail-layout{grid-template-columns:1.45fr .8fr}}
@media(max-width:820px){.auth-page{padding:14px}.auth-shell{grid-template-columns:1fr}.auth-brand{min-height:auto;padding:28px}.auth-copy h1{font-size:42px;letter-spacing:-2px}.security-points{display:none}.auth-card{padding:32px 28px}.topbar{grid-template-columns:auto auto;padding:0 15px;min-height:64px}.topbar>.brand small{display:none}.topnav{position:fixed;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));z-index:120;display:grid;grid-template-columns:repeat(4,1fr);background:rgba(255,255,255,.96);border:1px solid var(--line);padding:5px;border-radius:15px;box-shadow:0 14px 45px rgba(20,52,43,.18);backdrop-filter:blur(12px)}.topnav a{text-align:center;padding:9px 4px;font-size:10px}.user-menu{justify-self:end}.user-menu>div{display:none}.app-shell{width:min(100% - 24px,var(--max));padding:24px 0 calc(90px + env(safe-area-inset-bottom))}.folder-grid{grid-template-columns:repeat(2,1fr)}.stat-grid{grid-template-columns:repeat(2,1fr)}.profile-banner{grid-template-columns:auto 1fr}.profile-banner .btn{grid-column:1/-1}.filter-grid{grid-template-columns:repeat(2,1fr)}.filter-search{grid-column:1/-1}.filter-actions{grid-column:1/-1}.detail-layout{grid-template-columns:1fr}.meta-card{position:static}.doc-preview,.image-preview{min-height:65vh}.page-head h1{font-size:34px}}
@media(max-width:560px){.auth-brand{padding:22px}.auth-card{padding:27px 20px}.auth-copy h1{font-size:34px;letter-spacing:-1.5px}.auth-copy>p{font-size:14px}.topbar{gap:8px}.topbar>.brand b{font-size:15px}.brand-mark{width:32px;height:32px}.app-shell{width:calc(100% - 18px)}.page-head{margin-bottom:14px}.page-head h1{font-size:29px}.page-head p{font-size:12px}.profile-banner{padding:16px;border-radius:16px}.profile-avatar{width:44px;height:44px}.profile-banner h2{font-size:20px}.stat-grid{gap:8px}.stat-card{padding:14px}.stat-number{font-size:25px}.section-card{padding:14px;border-radius:15px}.folder-grid{grid-template-columns:1fr}.doc-row{grid-template-columns:auto minmax(0,1fr) auto;padding:11px 1px}.doc-row>.status{display:none}.doc-row>.chev{display:none}.toolbar .btn{flex:1}.filter-grid{grid-template-columns:1fr}.filter-search{grid-column:auto}.filter-actions{display:grid;grid-template-columns:1fr 1fr}.form-two{grid-template-columns:1fr}.preview-toolbar{align-items:flex-start;flex-direction:column}.preview-toolbar>div:last-child{width:100%}.preview-toolbar .btn{flex:1}.doc-preview,.image-preview{min-height:60vh}.meta-card{padding:14px}.printbar{align-items:flex-start;flex-direction:column}.printbar .btn{width:100%}.print-content{height:calc(100vh - 108px)}}
