/* ===== Arkaan — Documents, editor, letterhead, PDF export, hubs ===== */
.doc-layout{grid-template-columns:240px minmax(0,1fr)}
.doc-nav{align-self:start;position:sticky;top:76px}
.doc-nav .card-b{padding:10px}
.doc-nav-item{display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:8px;color:var(--text-2);font-weight:500;font-size:13.5px}
.doc-nav-item .ic{width:16px;height:16px;color:var(--muted)}
.doc-nav-item em{margin-left:auto;font-style:normal;font-size:11.5px;color:var(--muted)}
.doc-nav-item:hover{background:var(--surface-2);color:var(--text)}
.doc-nav-item.active{background:var(--brand-soft);color:var(--blue-2);font-weight:600}
.doc-nav-item.active .ic{color:var(--brand)}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;padding:14px 18px 18px}
.tpl{display:flex;flex-direction:column;gap:3px;border:1px solid var(--line);border-radius:12px;padding:12px;color:var(--text);background:var(--surface);transition:all .15s}
.tpl:hover{border-color:var(--brand);box-shadow:0 0 0 3px rgba(0,174,239,.12);transform:translateY(-1px)}
.tpl strong{font-size:13px}
.tpl small{color:var(--muted);font-size:11.5px;line-height:1.35}
.tpl-ic{width:32px;height:32px;border-radius:9px;background:var(--brand-soft);color:var(--blue-2);display:grid;place-items:center;margin-bottom:6px;font-weight:800}
.tpl-ic .ic{width:17px;height:17px}
.doc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.doc-card{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden;color:var(--text);box-shadow:var(--shadow);transition:all .15s;display:flex;flex-direction:column}
.doc-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg);border-color:color-mix(in srgb,var(--c) 45%,var(--line))}
.doc-thumb{height:110px;background:linear-gradient(135deg,color-mix(in srgb,var(--c) 12%,var(--surface-2)),var(--surface-2));display:flex;align-items:center;justify-content:center;gap:14px;border-bottom:1px solid var(--line-2)}
.doc-thumb .lines{display:flex;flex-direction:column;gap:6px;width:70px}
.doc-thumb .lines i{height:5px;border-radius:3px;background:color-mix(in srgb,var(--c) 25%,var(--line))}
.doc-thumb .lines i:nth-child(2){width:80%}
.doc-thumb .lines i:nth-child(4){width:60%}
.doc-meta{padding:12px;display:flex;flex-direction:column;gap:5px;flex:1}
.doc-meta strong{font-size:13.5px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.doc-meta small{color:var(--muted)}
.doc-meta .row{margin-top:auto}
.ftype{display:inline-grid;place-items:center;min-width:38px;height:30px;padding:0 6px;border-radius:7px;background:var(--c);color:#fff;font-size:10px;font-weight:800;letter-spacing:.04em;flex:none}
.ftype.big{min-width:54px;height:66px;border-radius:9px;font-size:12px;box-shadow:var(--shadow)}
.dropzone{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;border:2px dashed var(--line);border-radius:14px;padding:26px 16px;margin-bottom:14px;cursor:pointer;color:var(--muted);transition:all .15s;position:relative}
.dropzone:hover,.dropzone.drag{border-color:var(--brand);background:var(--brand-soft);color:var(--blue-2)}
.dropzone .ic{width:30px;height:30px;color:var(--brand)}
.dropzone strong{color:var(--text)}
.dropzone input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.dz-list{font-size:12.5px;color:var(--blue-2);font-weight:600}
.file-preview iframe{width:100%;height:78vh;border:0;border-radius:12px;display:block}

/* paper / letterhead */
.paper{background:#fff;color:#1a2433;border:1px solid var(--line);border-radius:6px;box-shadow:0 10px 30px -12px rgba(10,37,64,.25);padding:46px 54px 30px;max-width:860px;margin:0 auto;min-height:600px}
.letterhead{display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:3px solid #00AEEF;padding-bottom:12px;margin-bottom:26px}
.letterhead img{height:46px;width:auto}
.letterhead div{text-align:right}
.letterhead strong{display:block;color:#0A2540;font-size:12px;font-family:ui-monospace,Consolas,monospace}
.letterhead small{color:#7a8799;font-size:11px}
.paper-foot{border-top:1px solid #e3e8ef;margin-top:34px;padding-top:8px;font-size:10.5px;color:#7a8799;text-align:center}
.doc-body{font-size:14.5px;line-height:1.65;color:#1a2433;outline:0;min-height:300px}
.doc-body h1{font-size:25px;color:#0A2540;margin:0 0 12px;font-weight:800}
.doc-body h2{font-size:18px;color:#0080C0;margin:22px 0 8px}
.doc-body h3{font-size:15px;color:#0A2540;margin:18px 0 6px}
.doc-body p{margin:0 0 10px}
.doc-body ul,.doc-body ol{margin:0 0 12px;padding-left:24px}
.doc-body li{margin-bottom:3px}
.doc-body table{width:100%;border-collapse:collapse;margin:8px 0 16px;font-size:13.5px}
.doc-body th,.doc-body td{border:1px solid #d5dde8;padding:7px 10px;text-align:left;vertical-align:top;background:transparent;text-transform:none;letter-spacing:0;color:#1a2433;white-space:normal}
.doc-body th{background:#E6F7FE;color:#0A2540;font-weight:700;font-size:13px}
.doc-body tbody tr:hover{background:transparent}
.doc-body blockquote{border-left:4px solid #00AEEF;margin:10px 0;padding:6px 14px;background:#F3FBFE;color:#475569}
.doc-body img{max-width:100%;height:auto;border-radius:4px}
.doc-body hr{border:0;border-top:1px solid #d5dde8;margin:16px 0}
.doc-body a{color:#0080C0;text-decoration:underline}
.doc-title-input{font-size:22px!important;font-weight:800;padding:12px 14px!important;border-radius:12px!important}
.editor-wrap{background:var(--surface-2);border:1px solid var(--line);border-radius:14px}
.editor-wrap .toolbar{border-radius:14px 14px 0 0}
.editor-wrap .editor-foot{border-radius:0 0 14px 14px}
.toolbar{display:flex;flex-wrap:wrap;gap:3px;align-items:center;padding:8px;background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:61px;z-index:5}
.toolbar button{border:0;background:transparent;padding:6px 9px;border-radius:7px;cursor:pointer;font-size:13px;color:var(--text-2);display:inline-flex;align-items:center;gap:4px;min-width:32px;justify-content:center}
.toolbar button:hover{background:var(--brand-soft);color:var(--blue-2)}
.toolbar button .ic{width:15px;height:15px}
.toolbar select{width:auto;padding:5px 8px;font-size:13px}
.tb-sep{width:1px;height:22px;background:var(--line);margin:0 4px}
.editor-wrap .paper{margin:22px auto;border-radius:4px}
.editor-foot{display:flex;justify-content:space-between;gap:10px;padding:8px 14px;border-top:1px solid var(--line);background:var(--surface);flex-wrap:wrap}
@media (max-width:1100px){.doc-layout{grid-template-columns:minmax(0,1fr)}.doc-nav{position:static}}
@media (max-width:640px){.paper{padding:24px 18px}.letterhead img{height:34px}}

/* ===== PDF export ===== */
.pdf-sheet{background:#fff;color:#1a2433;width:1000px;padding:4px}
.pdf-sheet.portrait{width:760px}
.pdf-head{display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #00AEEF;padding-bottom:10px;margin-bottom:16px}
.pdf-head img{height:44px}
.pdf-head div{text-align:right;font-size:11px;color:#64748b}
.pdf-head b{display:block;color:#0A2540;font-size:16px}
.pdf-foot{margin-top:18px;border-top:1px solid #e3e8ef;padding-top:6px;font-size:9.5px;color:#94a3b8;text-align:center}
.pdf-sheet .card,.pdf-sheet .kpi,.pdf-sheet .hero{box-shadow:none!important;transform:none!important;break-inside:avoid}
.pdf-sheet .table-wrap{overflow:visible}
.pdf-sheet tr{break-inside:avoid}
.pdf-busy{position:fixed;inset:0;background:rgba(9,20,36,.45);display:grid;place-items:center;z-index:200;color:#fff;font-weight:700;font-size:15px}
.pdf-busy span{background:#0A2540;padding:14px 22px;border-radius:12px;box-shadow:var(--shadow-lg)}
@media print{.paper{box-shadow:none;border:0;padding:0;max-width:none}.editor-wrap .toolbar{display:none}}

/* ===== Hubs, notice board, profile ===== */
.hub-hero{border-radius:16px;padding:24px 26px;color:#fff;background:linear-gradient(120deg,#0A2540 0%,color-mix(in srgb,var(--c) 70%,#0A2540) 100%);display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;align-items:center;margin-bottom:18px}
.hub-hero h1{font-size:24px}
.hub-hero p{color:#D3E6F5;margin-top:6px}
.hub-hero .btn{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.25);color:#fff}
.hub-hero .btn.primary{background:#fff;color:#0A2540;border-color:#fff}
.quick-actions{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:18px}
.qa{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px;color:var(--text);font-weight:600;font-size:13px;box-shadow:var(--shadow);transition:all .15s}
.qa:hover{border-color:var(--brand);transform:translateY(-1px)}
.qa span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--brand-soft);color:var(--blue-2);flex:none}
.qa .ic{width:17px;height:17px}
.notice{border-left:4px solid var(--brand);background:var(--surface);padding:12px 16px;border-radius:0 10px 10px 0}
.notice+.notice{margin-top:10px}
.notice.pinned{border-left-color:#F59E0B;background:color-mix(in srgb,#F59E0B 6%,var(--surface))}
.notice strong{display:block}
.notice p{white-space:pre-wrap;color:var(--text-2);font-size:13px;margin-top:4px}
.notice small{color:var(--muted)}
.profile-cover{height:150px;border-radius:16px 16px 0 0;background:linear-gradient(120deg,#0A2540 0%,#0B4A75 55%,#00AEEF 100%);position:relative;overflow:hidden}
.profile-cover:after{content:"";position:absolute;right:30px;top:-30px;width:190px;height:240px;background:url(logo-mark-white.png) no-repeat center/contain;opacity:.12}
.profile-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);margin-bottom:18px}
.profile-main{display:flex;gap:8px 20px;align-items:flex-start;padding:0 26px 20px;margin-top:-60px;position:relative;flex-wrap:wrap}
.profile-main>.row{margin-top:72px}
.profile-photo{position:relative}
.profile-photo .av{width:120px;height:120px;font-size:40px;border:5px solid var(--surface);box-shadow:var(--shadow-lg)}
.profile-photo label{position:absolute;right:4px;bottom:6px;width:36px;height:36px;border-radius:50%;background:var(--blue-2);color:#fff;display:grid;place-items:center;cursor:pointer;border:3px solid var(--surface)}
.profile-photo label .ic{width:16px;height:16px}
.profile-photo input{display:none}
.profile-info{flex:1;min-width:220px;padding-top:70px}
.profile-info h1{font-size:24px}
.profile-info p{color:var(--muted);margin-top:3px}
.profile-tabs{display:flex;gap:4px;padding:0 20px;border-top:1px solid var(--line-2);overflow-x:auto}
.profile-tabs a{padding:12px 14px;color:var(--text-2);font-weight:600;font-size:13.5px;border-bottom:2px solid transparent;white-space:nowrap}
.profile-tabs a.active{color:var(--blue-2);border-bottom-color:var(--brand)}
.hero .btn.hero-btn{background:rgba(255,255,255,.12);color:#fff;border-color:rgba(255,255,255,.25)}
.hero .btn.hero-btn:hover{background:rgba(255,255,255,.2)}
@media (max-width:640px){.profile-info{padding-top:0;flex-basis:100%}.profile-main>.row{margin-top:0}.profile-main{margin-top:-60px}}
@media (max-width:1100px){
  .doc-nav .card-b{display:flex;overflow-x:auto;gap:6px;padding:8px}
  .doc-nav .nav-group{display:none}
  .doc-nav-item{white-space:nowrap;flex:none;border:1px solid var(--line)}
  .doc-nav-item em{margin-left:4px}
}
.live-bar{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);display:flex;align-items:center;gap:14px;background:#0A2540;color:#fff;padding:10px 12px 10px 18px;border-radius:30px;box-shadow:var(--shadow-lg);z-index:90;font-weight:600;font-size:13.5px;animation:slide .25s}
.live-bar button{border:0;background:#00AEEF;color:#fff;font-weight:700;border-radius:20px;padding:6px 14px;cursor:pointer}
.steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px;font-size:13.5px}
.code-block{background:#0A2540;color:#D7F2FD;padding:10px 12px;border-radius:8px;font:12px/1.5 ui-monospace,Consolas,monospace;overflow-x:auto;margin:6px 0 0;white-space:pre}
.small-link{font-size:12px;font-weight:600}
.login-help{text-align:center;margin-top:16px;font-size:13px}
.dev-ic{font-size:22px;width:34px;text-align:center}
