/* SKNAU PDF Editor components (2026-11-19). Shell (header/menu/drawer/footer) is assets/shell.css. */
:root {
  --bg: #f2f5f9; --fg: #1b2533; --muted: #5b6675; --line: #e3e8ef; --card: #fff;
  --navy: #0b2545; --blue: #004080; --blue2: #1d5fa8; --blue50: #eaf2fb; --gold: #d9a600;
  --ok: #15803d; --err: #b42318; --warn: #b45309;
  --r: 14px; --shadow: 0 10px 30px rgba(11, 37, 69, .08);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; color: var(--fg);
  font: 15px/1.55 'Poppins', 'Noto Sans Devanagari', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[lang="hi"] { font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }
main.page { flex: 1 0 auto; padding-top: 22px; padding-bottom: 30px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
h2 { font-size: 1.12rem; margin: 0 0 10px; }

/* title band */
.ptitle { background: linear-gradient(120deg, #0b2545, #13315c 55%, #1d5fa8); color: #fff; border-radius: 18px; padding: 22px 24px; margin: 0 0 18px; box-shadow: var(--shadow); }
.ptitle h1 { margin: 0; color: #fff; font-size: 1.5rem; display: flex; flex-direction: column; gap: 2px; }
.ptitle h1 small { font-size: .95rem; font-weight: 500; color: #cfe0f5; }
.ptitle p { margin: 8px 0 0; color: #dbe7f6; font-size: 14px; }

/* cards, buttons, inputs */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font: 600 14px 'Poppins', sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .2s, transform .1s; }
.btn:hover { background: var(--navy); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { min-height: 48px; font-size: 15px; }
.btn-o { background: #fff; color: var(--blue); border-color: #c9d6e6; }
.btn-o:hover { background: var(--blue50); color: var(--navy); }
.btn-ok { background: var(--ok); } .btn-ok:hover { background: #166534; }
.btn-red { background: #fff; color: var(--err); border-color: #f3c2bd; } .btn-red:hover { background: #fdecec; color: var(--err); }
.btn-sm { min-height: 36px; padding: 0 11px; font-size: 13px; }
.f { margin: 0 0 12px; }
.f label, .lbl { display: block; font-weight: 600; font-size: 13px; color: #344054; margin: 0 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 10px; font: 14px 'Poppins', 'Noto Sans Devanagari', sans-serif; background: #fff; color: var(--fg); }
textarea { min-height: 80px; resize: vertical; }
input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
input[type=range] { width: 100%; accent-color: var(--blue); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--blue); vertical-align: -3px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > .f { flex: 1 1 160px; min-width: 0; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; border: 1px solid; margin: 0 0 12px; font-size: 14px; }
.alert-err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-info { background: var(--blue50); border-color: #c9dcf2; color: #13315c; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 11px; border-radius: 999px; background: var(--blue50); color: var(--blue); font-size: 12.5px; font-weight: 600; border: 1px solid #c9dcf2; }
.chip.srv { background: #fff7e6; color: var(--warn); border-color: #f6d9a6; }
.chip.loc { background: #f0fdf4; color: var(--ok); border-color: #bbf7d0; }

/* login */
.login-grid { display: grid; gap: 20px; align-items: start; grid-template-columns: 1fr; max-width: 1000px; margin: 0 auto; }
.login-intro h1 { font-size: 1.8rem; margin: 12px 0 6px; display: flex; flex-direction: column; }
.login-intro h1 small { font-size: 1.05rem; color: var(--blue2); font-weight: 600; }
.login-intro .lead { color: var(--muted); margin: 0 0 12px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ticks i { color: var(--blue); width: 22px; text-align: center; margin-top: 3px; }
.login-card { padding: 24px; }
.auth .eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--blue); padding: 3px 10px; border-radius: 999px; background: var(--blue50); }
.auth h2 { margin: 10px 0 4px; font-size: 1.3rem; }
.auth .sub { color: var(--muted); font-size: 14px; }
.auth .alert { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.auth .alert.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.auth .field { margin: 12px 0; }
.auth .control { position: relative; }
.auth .control i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.auth .btn { width: 100%; }
.auth .btn .spin, .auth .btn .arrow { display: none; }
.auth .meta { display: flex; margin-top: 12px; font-size: 13.5px; }
.auth .link, .auth .back { color: var(--blue); font: 600 13.5px 'Poppins', sans-serif; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.auth .link:disabled { color: #9ca3af; }
@media (min-width: 860px) { .login-grid { grid-template-columns: 1.1fr .9fr; gap: 36px; margin-top: 18px; } }

/* tool hub */
.hub-search { display: flex; gap: 10px; margin: 0 0 16px; }
.hub-search input { flex: 1; min-height: 46px; }
.grp { margin: 0 0 22px; }
.grp h2 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.grp h2 small { color: var(--muted); font-weight: 500; font-size: .9rem; }
.tools { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tool { display: flex; gap: 12px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--fg); text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s; }
.tool:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9dcf2; color: var(--fg); }
.tool .ic { flex: 0 0 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--blue50); color: var(--blue); font-size: 20px; }
.tool b { display: block; font-size: 15px; color: var(--navy); }
.tool .hi { display: block; font-size: 13.5px; color: var(--blue2); font-weight: 600; }
.tool p { margin: 4px 0 6px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.privacy { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.privacy .card i.big { font-size: 22px; color: var(--blue); }

/* drop zone */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 30px 16px; border: 2px dashed #9db6d6; border-radius: 18px;
  background: #fff; cursor: pointer; transition: background .2s, border-color .2s; }
.drop:hover, .drop.over { background: var(--blue50); border-color: var(--blue); }
.drop i { font-size: 34px; color: var(--blue); }
.drop b { font-size: 16px; color: var(--navy); }
.drop input { display: none; }

/* workspace */
.ws { display: grid; gap: 16px; grid-template-columns: 1fr; }
.ws-side .card { position: sticky; top: 100px; }
@media (min-width: 1000px) { .ws { grid-template-columns: minmax(0, 1fr) 320px; } }
.opts h3 { margin: 4px 0 8px; font-size: .95rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.seg label { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: #344054; background: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--blue); border-color: var(--blue); color: #fff; }
.filelist { display: grid; gap: 8px; }
.fileitem { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.fileitem .th { flex: 0 0 44px; height: 56px; border-radius: 6px; background: #f1f5f9; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.fileitem .th img, .fileitem .th canvas { width: 100%; height: 100%; object-fit: contain; }
.fileitem .nm { flex: 1; min-width: 0; }
.fileitem .nm b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem .nm span { font-size: 12.5px; color: var(--muted); }
.fileitem .handle { cursor: grab; color: #94a3b8; padding: 8px; min-width: 36px; min-height: 40px; display: grid; place-items: center; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #475569; cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--blue50); color: var(--blue); }
.icon-btn.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.icon-btn.red:hover { background: #fdecec; color: var(--err); }

/* page thumbnails (organize / split / select) */
.thumbs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); }
.pg { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 8px 6px; text-align: center; user-select: none; transition: border-color .15s, box-shadow .15s; }
.pg.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 95, 168, .18); }
.pg .cv { aspect-ratio: 1 / 1.3; display: grid; place-items: center; overflow: hidden; background: #f8fafc; border-radius: 6px; cursor: grab; }
.pg canvas, .pg img { max-width: 100%; max-height: 100%; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); transition: transform .2s; background: #fff; }
.pg .no { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 5px; }
.pg .acts { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.pg .acts button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f1f5f9; color: #475569; cursor: pointer; }
.pg .acts button:hover { background: var(--blue50); color: var(--blue); }
.pg .ck { position: absolute; top: 12px; left: 12px; width: 26px; height: 26px; border-radius: 7px; background: #fff; border: 2px solid #94a3b8; display: grid; place-items: center; color: #fff; font-size: 13px; cursor: pointer; z-index: 2; }
.pg.sel .ck { background: var(--blue); border-color: var(--blue); }
.pg.blank .cv::after { content: 'Blank'; color: #94a3b8; font-size: 13px; }
.sortable-ghost { opacity: .35; }

/* toolbar */
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.bar .sp { flex: 1; }
.result { margin-top: 14px; }
.progress { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #4f9be0); transition: width .2s; }

/* ===== visual editor (edit / sign / redact) ===== */
body.is-editor main.page { padding-top: 12px; }
.ed { display: grid; grid-template-columns: 1fr; gap: 12px; }
.ed-tools { display: flex; gap: 6px; overflow-x: auto; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; position: sticky; top: 74px; z-index: 20; scrollbar-width: thin; }
.ed-tools .icon-btn { flex: 0 0 auto; width: auto; min-width: 44px; height: 44px; padding: 0 10px; gap: 6px; font-size: 13px; font-weight: 600; }
.ed-tools .icon-btn span { display: none; }
.ed-tools .sep { flex: 0 0 1px; background: var(--line); margin: 4px 2px; }
.ed-props { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.ed-props label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #344054; }
.ed-props select, .ed-props input[type=number] { width: auto; min-height: 38px; padding: 4px 8px; }
.ed-props input[type=range] { width: 100px; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 6px; background: #e6ebf2; border-radius: 14px; overflow: auto; max-height: calc(100dvh - 150px); min-height: 60vh; }
.ed-page { position: relative; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .18); flex: 0 0 auto; }
.ed-page > canvas.base { display: block; width: 100%; height: 100%; }
.ed-page .lay { position: absolute; inset: 0; touch-action: none; }
.ed-page .pno { position: absolute; left: 0; top: -17px; font-size: 11.5px; color: #475569; font-weight: 600; }
.ob { position: absolute; box-sizing: border-box; cursor: move; touch-action: none; }
.ob.selected { outline: 1.5px dashed var(--blue2); outline-offset: 2px; }
.ob .hd { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--blue2); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.ob.selected .hd { display: block; }
.ob .del { position: absolute; right: -11px; top: -11px; width: 24px; height: 24px; border-radius: 50%; background: var(--err); color: #fff; border: 2px solid #fff; display: none; place-items: center; font-size: 11px; cursor: pointer; }
.ob.selected .del { display: grid; }
.ob.text { padding: 0; white-space: pre; line-height: 1.2; min-width: 10px; min-height: 10px; }
.ob.text[contenteditable="true"] { cursor: text; outline: 1.5px solid var(--blue2); background: rgba(255,255,255,.6); }
.ob svg, .ob img, .ob canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.ob.note { width: 26px; height: 26px; background: #fde047; border-radius: 4px; display: grid; place-items: center; font-size: 14px; color: #713f12; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.ed-side { display: none; }
.ed-thumbs { display: flex; flex-direction: column; gap: 10px; }
.ed-thumbs button { border: 2px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; cursor: pointer; }
.ed-thumbs button.on { border-color: var(--blue); }
.ed-thumbs canvas { width: 100%; display: block; }
.ed-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
@media (min-width: 1000px) {
  .ed { grid-template-columns: 130px minmax(0, 1fr); }
  .ed-side { display: block; max-height: calc(100dvh - 150px); overflow: auto; }
  .ed-tools .icon-btn span { display: inline; }
  .ed-tools { top: 140px; }
}
@media (max-width: 700px) {
  .ed-tools { top: 70px; }
}

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(7, 31, 61, .55); padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); }
.modal-box h2 { display: flex; justify-content: space-between; align-items: center; }
.sigpad { width: 100%; height: 180px; border: 1px dashed #94a3b8; border-radius: 12px; background: #fff; touch-action: none; display: block; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.tabs button { flex: 1 1 auto; min-height: 40px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; font: 600 13px 'Poppins', sans-serif; cursor: pointer; color: #344054; }
.tabs button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.sig-saved { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-saved button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; cursor: pointer; height: 60px; min-width: 90px; }
.sig-saved img { height: 100%; }

/* toast + busy */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; background: #0b2545; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { background: var(--err); }
.busy { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(255,255,255,.75); }
.busy div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; font-weight: 600; max-width: calc(100vw - 32px); }
.busy i { color: var(--blue); font-size: 22px; }

@media (max-width: 700px) {
  input, select, textarea { font-size: 16px !important; }
  .ptitle { padding: 18px 16px; }
  .ptitle h1 { font-size: 1.3rem; }
  .card { padding: 15px; }
  .bar .btn { flex: 1 1 auto; }
}
