/* OMRAN E-Mail-Assistent – navy reception theme. System fonts only. */
:root{
  --lobby:#12312c; --lobby-2:#1b4740; --lobby-3:#26594f; --lobby-ink:#e6eee8; --lobby-muted:#9db5ab;
  --bg:#edf1ee; --card:#ffffff; --ink:#16231f; --muted:#5b6b64; --line:#d6dfd9; --line-2:#e6ece8;
  --brass:#b8893a; --brass-2:#a27630; --brass-soft:#f5ecd9; --brass-ink:#3a2806;
  --ok:#2c7651; --ok-bg:#e4f1e9; --bad:#b3261e; --bad-bg:#fbebea; --warn:#7f5300; --warn-bg:#fff3d6;
  --focus:0 0 0 3px rgba(184,137,58,.45);
  --serif:"Iowan Old Style","Palatino Linotype","Book Antiqua",Palatino,"URW Palladio L",Georgia,serif;
  --sans:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Roboto,Arial,"Noto Sans Arabic","Geeza Pro",Tahoma,sans-serif;
  --mono:ui-monospace,"Cascadia Mono",Consolas,Menlo,monospace;
  --r-lg:16px; --r:10px; --r-sm:7px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 var(--sans);-webkit-font-smoothing:antialiased}
[dir=rtl] body{font-size:15.5px}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--lobby-3)}
h1,h2,h3,h4{margin:0;font-weight:600;line-height:1.2}
[hidden]{display:none!important}
:focus-visible{outline:none;box-shadow:var(--focus);border-radius:6px}
.ic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
[dir=rtl] .ic.flip{transform:scaleX(-1)}
.muted{color:var(--muted)} .small{font-size:13px} .grow{flex:1}
.boot{min-height:100vh;display:grid;place-items:center;font:600 22px var(--serif);color:var(--lobby)}
.boot.err{color:var(--bad);font:15px var(--sans);padding:24px;text-align:center}

/* ---------- Buttons & fields ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 16px;border-radius:var(--r);border:1px solid var(--line);background:var(--card);color:var(--ink);font-weight:600;font-size:14px;cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,transform .05s}
.btn:hover{border-color:#b9c6be;background:#f7faf8}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.55;cursor:default;transform:none}
.btn.primary{background:var(--lobby);border-color:var(--lobby);color:#fff}
.btn.primary:hover{background:var(--lobby-2)}
.btn.brass{background:var(--brass);border-color:var(--brass-2);color:#fff;box-shadow:inset 0 -2px 0 rgba(0,0,0,.12)}
.btn.brass:hover{background:var(--brass-2)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted)}
.btn.ghost:hover{background:rgba(18,49,44,.06);color:var(--ink)}
.btn.danger{background:var(--bad);border-color:var(--bad);color:#fff}
.btn.danger.ghost{background:transparent;border-color:transparent;color:var(--bad)}
.btn.danger.ghost:hover{background:var(--bad-bg)}
.btn.big{min-height:46px;padding:10px 20px;font-size:15px}
.btn.full{width:100%}
.btn .ic{width:18px;height:18px}
.spin{width:15px;height:15px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.iconbtn{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:var(--r);border:0;background:transparent;color:inherit;cursor:pointer}
.iconbtn:hover{background:rgba(255,255,255,.08)}
.modal .iconbtn:hover{background:var(--line-2)}
.textlink{font-size:13.5px;font-weight:600;color:var(--lobby-3)}

.field{display:grid;gap:6px;font-size:13.5px;font-weight:600;color:#33433d;min-width:0}
.field small{font-weight:400;color:var(--muted);font-size:12.5px;line-height:1.45}
fieldset.field{border:0;padding:0;margin:0}
fieldset.field legend{padding:0;margin-bottom:6px}
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea{width:100%;border:1px solid var(--line);border-radius:var(--r-sm);background:#fbfcfb;padding:9px 11px;font-weight:400;font-size:15px;color:var(--ink);min-height:42px;transition:border-color .15s,background .15s}
textarea{resize:vertical;line-height:1.55}
input:hover,select:hover,textarea:hover{border-color:#bccac2}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brass);background:#fff;box-shadow:var(--focus)}
select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#5b6b64 50%),linear-gradient(135deg,#5b6b64 50%,transparent 50%);background-position:calc(100% - 17px) 55%,calc(100% - 12px) 55%;background-size:5px 5px;background-repeat:no-repeat;padding-inline-end:32px}
[dir=rtl] select{background-position:17px 55%,12px 55%}
.inline{display:flex;gap:8px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.stack{display:grid;gap:14px}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.form-error{background:var(--bad-bg);color:var(--bad);border-radius:var(--r-sm);padding:10px 12px;font-size:14px}
.banner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:space-between;border-radius:var(--r);padding:12px 14px;margin-bottom:16px;font-size:14px}
.banner.warn{background:var(--warn-bg);color:var(--warn)} .banner.bad{background:var(--bad-bg);color:var(--bad)}
.seg{display:inline-flex;background:var(--line-2);border-radius:var(--r);padding:3px;gap:2px;flex-wrap:wrap}
.seg label{position:relative;cursor:pointer}
.seg input{position:absolute;opacity:0;inset:0}
.seg span{display:block;padding:7px 14px;border-radius:8px;font-size:14px;font-weight:600;color:var(--muted)}
.seg input:checked+span{background:var(--card);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.seg input:focus-visible+span{box-shadow:var(--focus)}
.big-seg span{padding:9px 18px}
.switch{display:flex;align-items:center;gap:12px;font-size:14.5px;cursor:pointer;margin:4px 0 14px}
.switch input{position:absolute;opacity:0}
.switch span{width:42px;height:24px;border-radius:99px;background:#c4cfc9;position:relative;flex:none;transition:background .15s}
.switch span::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch input:checked+span{background:var(--lobby-3)}
.switch input:checked+span::after{transform:translateX(18px)}
[dir=rtl] .switch input:checked+span::after{transform:translateX(-18px)}
.switch input:focus-visible+span{box-shadow:var(--focus)}
.switch input:disabled+span{opacity:.5}
.tag{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:99px;background:var(--line-2);color:#3c4c46;font-size:12.5px;font-weight:600;white-space:nowrap}
.tag.dark{background:var(--lobby);color:#fff}
.tag.sm{padding:1px 7px;font-size:11.5px}
.status{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:600;white-space:nowrap}
.status .ic{width:16px;height:16px}
.status.sent{color:var(--ok)} .status.open{color:var(--muted)} .status.off{color:var(--bad)}
.avatar{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--brass-soft);color:var(--brass-ink);font-weight:700;font-size:12.5px;flex:none;letter-spacing:.02em}
.avatar.sm{width:28px;height:28px;font-size:11px}
.pre{white-space:pre-wrap;word-break:break-word;background:#f6f8f7;border:1px solid var(--line-2);border-radius:var(--r);padding:12px 14px;font-size:14.5px;line-height:1.6}
.pre.mono{font-family:var(--mono);font-size:14px}
.pre.readonly{min-height:220px;background:#fafbfa}

/* ---------- Auth ---------- */
.auth{min-height:100vh;display:grid;place-items:center;align-content:center;gap:18px;padding:32px 16px;background:radial-gradient(1200px 500px at 50% -10%,#24564c 0%,var(--lobby) 55%,#0c2420 100%)}
.auth-card{width:min(440px,100%);background:var(--card);border-radius:20px;padding:28px;box-shadow:0 30px 60px -20px rgba(0,0,0,.45)}
.auth-card.wide{width:min(620px,100%)}
.auth-card h1{font:600 30px/1.15 var(--serif);margin:26px 0 6px;color:var(--lobby)}
.auth-card>p{margin:0 0 20px}
.auth-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.auth-top .brand b{color:var(--ink)} .auth-top .brand small{color:var(--muted)}
.auth-foot{color:var(--lobby-muted);font-size:13px;margin:0}
.langswitch{display:inline-flex;border:1px solid var(--line);border-radius:99px;padding:2px}
.langswitch button{border:0;background:none;padding:4px 10px;border-radius:99px;font-size:12.5px;font-weight:700;color:var(--muted);cursor:pointer}
.langswitch button.on{background:var(--lobby);color:#fff}
.checks-list{list-style:none;padding:0;margin:0 0 18px;display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;font-size:13.5px}
.checks-list li{display:flex;align-items:center;gap:7px}
.checks-list .ok{color:var(--ok)} .checks-list .bad{color:var(--bad);font-weight:600} .checks-list .warn{color:var(--warn)}
.checks-list .ic{width:16px;height:16px}

/* ---------- Brand / key tag ---------- */
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand b{display:block;font:600 16px/1.2 var(--serif);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.brand small{display:block;font-size:12px;color:var(--lobby-muted)}
.keytag{position:relative;width:38px;height:50px;border-radius:9px 9px 15px 15px;background:linear-gradient(160deg,#d4a752,var(--brass) 45%,#946a28);display:grid;place-items:end center;padding-bottom:8px;transform:rotate(-7deg);box-shadow:0 6px 12px -4px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.35);flex:none}
.keytag i{position:absolute;top:7px;left:50%;width:9px;height:9px;margin-left:-4.5px;border-radius:50%;background:var(--lobby);box-shadow:inset 0 1px 2px rgba(0,0,0,.5)}
.auth .keytag i{background:#fff;box-shadow:inset 0 1px 2px rgba(0,0,0,.35)}
.keytag span{font:700 13px/1 var(--serif);color:#3a2806;letter-spacing:.04em}

/* ---------- Shell ---------- */
.shell{display:grid;grid-template-columns:252px minmax(0,1fr);min-height:100vh}
.side{background:var(--lobby);color:var(--lobby-ink);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;padding:20px 14px 14px}
.side-top{display:flex;align-items:center;justify-content:space-between;padding:4px 8px 22px}
.menu-btn{display:none}
.nav{display:grid;gap:2px}
.nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:var(--lobby-muted);text-decoration:none;font-weight:600;font-size:14.5px;position:relative}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.nav a.active{background:var(--lobby-2);color:#fff}
.nav a.active::before{content:"";position:absolute;inset-inline-start:-14px;top:9px;bottom:9px;width:4px;border-radius:0 4px 4px 0;background:var(--brass)}
[dir=rtl] .nav a.active::before{border-radius:4px 0 0 4px}
.nav a.active .ic{color:var(--brass)}
.side-foot{margin-top:auto;display:flex;align-items:center;gap:6px;border-top:1px solid rgba(255,255,255,.1);padding-top:12px}
.me{display:flex;align-items:center;gap:10px;flex:1;min-width:0;text-decoration:none;color:inherit;padding:6px;border-radius:10px}
.me:hover,.me.active{background:rgba(255,255,255,.06)}
.me b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me small{display:block;font-size:12px;color:var(--lobby-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me>span:last-child{min-width:0}
.main{padding:30px clamp(16px,3vw,40px) 60px;min-width:0;max-width:1480px}
.pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.pagehead h1{font:600 clamp(26px,3vw,34px)/1.1 var(--serif);color:var(--lobby);letter-spacing:-.01em}
.pagehead p{margin:6px 0 0;color:var(--muted);max-width:68ch}

/* ---------- Panels ---------- */
.panel{background:var(--card);border:1px solid var(--line-2);border-radius:var(--r-lg);padding:20px;box-shadow:0 1px 0 rgba(18,49,44,.04),0 10px 30px -18px rgba(18,49,44,.18);min-width:0}
.panel-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.panel-h h2{font-size:16px;color:var(--ink)}
.count{font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}

/* ---------- Compose ---------- */
.compose{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:22px;align-items:start}
.guest{display:grid;gap:16px;position:sticky;top:20px}
.mailbox{min-height:300px;font-size:14.5px;background:#fbfcfb;border-style:dashed!important;border-width:1.5px!important}
.mailbox:focus{border-style:solid!important}
.opts{gap:12px}
.trans summary{cursor:pointer;font-weight:600;font-size:14px;margin-bottom:8px;color:var(--lobby-3)}
.trans .pre{max-height:360px;overflow:auto}
.reply{min-height:520px}
@media (max-width:1180px){.reply{min-height:0}}
.empty-steps{padding:16px 6px}
.empty-steps h2{font:600 22px var(--serif);color:var(--lobby);margin-bottom:18px}
.empty-steps ol{list-style:none;counter-reset:s;margin:0;padding:0;display:grid;gap:18px}
.empty-steps li{counter-increment:s;display:grid;grid-template-columns:40px 1fr;column-gap:14px}
.empty-steps li::before{content:counter(s);grid-row:span 2;width:36px;height:36px;border-radius:50%;border:1.5px solid var(--brass);color:var(--brass-2);display:grid;place-items:center;font:600 16px var(--serif)}
.empty-steps b{font-size:15px} .empty-steps span{color:var(--muted);font-size:14px}
.writing{display:grid;place-items:center;gap:16px;padding:40px 10px;color:var(--muted)}
.sheet-skel{width:min(420px,90%);background:#fbfbf9;border:1px solid var(--line-2);border-radius:6px;padding:26px;display:grid;gap:11px;box-shadow:0 12px 30px -16px rgba(0,0,0,.25)}
.sheet-skel i{display:block;height:10px;border-radius:4px;background:linear-gradient(90deg,#e8ede9,#f4f6f4,#e8ede9);background-size:200% 100%;animation:shimmer 1.3s infinite}
.sheet-skel i.short{width:55%}
@keyframes shimmer{to{background-position:-200% 0}}
.reply-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.langflow{display:inline-flex;align-items:center;gap:8px;color:var(--muted)}
.langflow .ic{width:16px;height:16px}
.guest-line{display:flex;flex-wrap:wrap;gap:4px 12px;margin:-8px 0 14px;font-size:14px;color:var(--muted)}
.guest-line b{color:#33433d;font-weight:600}
.topic{font:600 21px/1.3 var(--serif);color:var(--ink);margin:4px 0 14px}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:12px}
.tabs button{border:0;background:none;padding:9px 12px;font-weight:600;font-size:14px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs button.on{color:var(--lobby);border-bottom-color:var(--brass)}
.reply-edit{min-height:220px;font-size:15px;line-height:1.65;background:#fff}
.edited{display:block;margin-top:6px}
.checkbox-list{margin:16px 0;background:var(--warn-bg);border-radius:var(--r);padding:12px 16px}
.checkbox-list h3{font-size:14px;color:var(--warn);margin-bottom:6px}
.checkbox-list ul{margin:0;padding-inline-start:20px;font-size:14px;color:#4d3800}
.checkbox-list li{margin:3px 0}
.sigpick{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin:18px 0 14px}
.sigpick .field{flex:1;min-width:220px}
.sigpick a{padding-bottom:11px}

/* The letter: what the guest will receive */
.letter{margin:22px 0 4px}
.letter-cap{font-size:12.5px;color:var(--muted);margin-bottom:8px}
.letter-sheet{background:#fff;border:1px solid #e3e6e1;border-top:3px solid var(--brass);border-radius:3px;padding:24px 26px;box-shadow:0 1px 0 #eef0ec,0 18px 36px -24px rgba(23,35,31,.45);max-height:520px;overflow:auto;color:#1f1f1f}
.letter-sheet img{max-width:100%;height:auto}
.letter-sig{margin-top:2px}
.copybar{margin-top:4px}
.copyhint{margin:4px 0 0;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px}
.copyhint.done{color:var(--ok);font-weight:600}
.copyhint .ic{width:17px;height:17px}

/* ---------- History / ledger ---------- */
.filters{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px;align-items:center}
.filters input[type=search]{flex:1 1 260px;width:auto}
.filters select{width:auto;flex:0 1 190px}
.datef{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.datef input{width:auto!important}
input[type=date]{direction:ltr;text-align:left}
.ledger-wrap{background:var(--card);border:1px solid var(--line-2);border-radius:var(--r-lg);overflow:auto;box-shadow:0 10px 30px -18px rgba(18,49,44,.18)}
.ledger-count{padding:12px 16px 0;font-size:13px;color:var(--muted)}
.ledger{width:100%;border-collapse:collapse;font-size:14px}
.ledger th{text-align:start;font-weight:600;font-size:12.5px;color:var(--muted);padding:12px 16px;border-bottom:1px solid var(--line);white-space:nowrap}
.ledger td{padding:12px 16px;border-bottom:1px solid var(--line-2);vertical-align:middle}
.ledger tbody tr{cursor:pointer;transition:background .1s}
.ledger tbody tr:hover{background:#f6f9f7}
.ledger tbody tr:last-child td{border-bottom:0}
.ledger td small{display:block;color:var(--muted);font-size:12.5px}
.ledger .when{white-space:nowrap;color:#3c4c46;font-variant-numeric:tabular-nums}
.ledger .topic-cell{max-width:380px;color:#2b3a35}
.who{display:inline-flex;align-items:center;gap:9px;white-space:nowrap}
.who b{display:block}
.num-col{text-align:end;font-variant-numeric:tabular-nums}
.pager{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px;font-size:13.5px;color:var(--muted);border-top:1px solid var(--line-2)}
.empty{text-align:center;padding:50px 20px;color:var(--muted);display:grid;gap:14px;justify-items:center;background:var(--card);border-radius:var(--r-lg);border:1px dashed var(--line)}
.loading-line{height:3px;border-radius:3px;background:linear-gradient(90deg,transparent,var(--brass),transparent);background-size:50% 100%;background-repeat:no-repeat;animation:load 1s infinite linear;margin:20px 0}
@keyframes load{from{background-position:-50% 0}to{background-position:150% 0}}

/* ---------- Dashboard ---------- */
.seg-links{display:inline-flex;background:var(--card);border:1px solid var(--line-2);border-radius:12px;padding:3px;flex-wrap:wrap}
.seg-links a{padding:7px 13px;border-radius:9px;text-decoration:none;color:var(--muted);font-weight:600;font-size:13.5px}
.seg-links a.on{background:var(--lobby);color:#fff}
.tally{display:grid;grid-template-columns:repeat(4,1fr);background:var(--card);border:1px solid var(--line-2);border-radius:var(--r-lg);margin-bottom:22px;overflow:hidden}
.tally>div{padding:18px 22px;display:grid;gap:2px;border-inline-start:1px solid var(--line-2)}
.tally>div:first-child{border-inline-start:0;background:var(--lobby);color:#fff}
.tally .num{font:600 38px/1.05 var(--serif);font-variant-numeric:lining-nums tabular-nums;letter-spacing:-.01em}
.tally .num small{font-size:20px;margin-inline-start:2px}
.tally .lbl{font-size:13px;color:var(--muted)}
.tally>div:first-child .lbl{color:var(--lobby-muted)}
.legend{font-size:12.5px;color:var(--muted);display:inline-flex;align-items:center;gap:6px}
.lg{display:inline-block;width:10px;height:10px;border-radius:3px;margin-inline-start:8px}
.lg.gen{background:#cfdad3} .lg.sent{background:var(--lobby-3)}
.chart{display:grid;grid-template-columns:repeat(var(--n),1fr);align-items:end;gap:min(6px,.4vw);height:180px;padding-top:6px;border-bottom:1px solid var(--line)}
.chart .col{position:relative;height:100%;display:flex;align-items:flex-end;justify-content:center}
.chart .col i{position:absolute;bottom:0;left:12%;right:12%;border-radius:3px 3px 0 0;min-height:0}
.chart .col i.gen{background:#d5dfd8}
.chart .col i.sent{background:var(--lobby-3)}
.chart .col:hover i.sent{background:var(--brass)}
.chart-axis{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-top:6px}
.dash-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:22px;margin-top:22px;align-items:start}
.team-table td,.team-table th{padding-inline:10px}
.team-table tr.deleted{opacity:.6}
.barcell{display:flex;align-items:center;gap:10px;min-width:150px}
.barcell b{font-variant-numeric:tabular-nums;min-width:2ch}
.bar{flex:1;height:8px;background:var(--line-2);border-radius:99px;overflow:hidden;min-width:60px}
.bar i{display:block;height:100%;background:var(--brass);border-radius:99px}
.hbars{list-style:none;padding:0;margin:0;display:grid;gap:10px}
.hbars li{display:grid;grid-template-columns:minmax(80px,1fr) 2fr auto;align-items:center;gap:10px;font-size:14px}
.hbars .bar i{background:var(--lobby-3)}
.hbars b{font-variant-numeric:tabular-nums}
.usage{margin-top:18px;border-top:1px solid var(--line-2);padding-top:12px;line-height:1.7}

/* ---------- Modal ---------- */
.modal-wrap{position:fixed;inset:0;background:rgba(10,26,23,.5);display:grid;place-items:center;padding:16px;z-index:50;animation:fade .12s}
@keyframes fade{from{opacity:0}}
.modal{background:var(--card);border-radius:18px;width:min(520px,100%);max-height:calc(100vh - 32px);display:flex;flex-direction:column;box-shadow:0 30px 70px -20px rgba(0,0,0,.5);animation:pop .16s ease-out}
.modal.wide{width:min(860px,100%)}
@keyframes pop{from{transform:translateY(8px) scale(.98);opacity:0}}
.modal-h{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:20px 22px 10px}
.modal-h h3{font:600 21px/1.25 var(--serif);color:var(--lobby)}
.modal-h p{margin:4px 0 0;font-size:13.5px}
.modal-b{padding:10px 22px 16px;overflow:auto}
.modal-b h4{font-size:13.5px;color:var(--muted);margin:18px 0 8px}
.modal-f{display:flex;align-items:center;gap:10px;padding:14px 22px;border-top:1px solid var(--line-2);flex-wrap:wrap}
.confirm-text{font-size:16px;margin:14px 0 4px}
.facts{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0;background:#f6f8f7;border-radius:var(--r);padding:12px 14px}
.facts dt{font-size:12px;color:var(--muted)} .facts dd{margin:2px 0 0;font-weight:600;font-size:14px}
ul.plain{margin:0;padding-inline-start:20px}

/* ---------- Signatures ---------- */
.sig-layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:22px;align-items:start}
.sig-list{padding:16px;position:sticky;top:20px}
.sig-list ul{list-style:none;padding:0;margin:12px 0 0;display:grid;gap:2px;max-height:60vh;overflow:auto}
.sig-list li button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:start;padding:9px 11px;border:0;background:none;border-radius:9px;cursor:pointer;font-size:14px;font-weight:500}
.sig-list li button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sig-list li button:hover{background:#f3f6f4}
.sig-list li button.on{background:var(--brass-soft);font-weight:700}
.def{display:inline-flex;align-items:center;gap:3px;font-style:normal;font-size:11.5px;color:var(--brass-2);font-weight:700;flex:none}
.def .ic{width:13px;height:13px;fill:currentColor}
.pad{padding:8px 11px}
.sig-edit{display:grid;gap:14px}
.sig-namerow{align-items:end}
.sig-import{display:flex;justify-content:flex-end}
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:6px;border:1px solid var(--line);border-radius:var(--r) var(--r) 0 0;background:#f7f9f8;margin-bottom:-15px}
.toolbar button{min-width:34px;height:34px;border:0;background:none;border-radius:7px;cursor:pointer;display:inline-grid;place-items:center;font-size:15px;color:#33433d}
.toolbar button:hover,.toolbar button.on{background:#e5ebe7}
.toolbar select{width:auto!important;min-height:34px!important;padding:4px 30px 4px 9px!important;font-size:13.5px!important;background-color:transparent!important;border-color:transparent!important}
.toolbar .ic{width:18px;height:18px}
.tb-sep{width:1px;height:22px;background:var(--line);margin:0 4px}
.tb-color{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:7px;cursor:pointer}
.tb-color input{width:24px;height:24px;border:0;padding:0;background:none;cursor:pointer}
.tb-img{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted);margin-inline-start:auto;padding-inline:6px;background:var(--brass-soft);border-radius:7px}
.tb-img input{width:110px}
.sig-canvas{border:1px solid var(--line);border-radius:0 0 var(--r) var(--r);background:#fff}
.sig-editor{text-align:left;min-height:240px;padding:20px;outline:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:11pt;color:#1f1f1f;overflow:auto}
.sig-editor:empty::before{content:attr(data-ph);color:#98a59f}
.sig-editor img{max-width:100%;cursor:pointer}
.sig-editor img.sel{outline:2px solid var(--brass);outline-offset:2px}
.sig-editor .missing-img{display:inline-block;padding:6px 10px;border:1.5px dashed var(--warn);color:var(--warn);background:var(--warn-bg);border-radius:6px;font:12px var(--sans)}
.sig-source{border:0!important;border-radius:0 0 var(--r) var(--r)!important;min-height:300px;font-family:var(--mono)!important;font-size:13px!important;background:#fbfcfb!important}
.howto{background:#f6f8f7;border-radius:var(--r);padding:12px 16px}
.howto summary{cursor:pointer;font-weight:600;color:var(--lobby-3)}
.howto ol{margin:12px 0 6px;padding-inline-start:20px;display:grid;gap:8px;font-size:14px}
.howto code{background:#fff;border:1px solid var(--line);border-radius:5px;padding:1px 6px;font-family:var(--mono);font-size:13px;white-space:nowrap}

/* ---------- Settings / profile ---------- */
.settings{display:grid;gap:22px;max-width:980px}
.settings .panel{display:grid;gap:14px}
.settings .panel-h{margin-bottom:0}
.prov-box{border:1px solid var(--line-2);border-radius:var(--r);padding:14px;transition:opacity .15s}
.prov-box.dim{opacity:.5}
.narrow{max-width:280px}
.sticky-save{position:sticky;bottom:12px}
.ok-text{color:var(--ok);display:inline-flex;align-items:center;gap:6px;font-weight:600}
.bad-text{color:var(--bad)}
.profile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:22px;max-width:900px}

/* ---------- Toast ---------- */
.toast{position:fixed;bottom:22px;left:50%;transform:translate(-50%,20px);background:var(--ink);color:#fff;padding:11px 18px;border-radius:12px;font-size:14px;font-weight:600;opacity:0;pointer-events:none;transition:.2s;z-index:80;max-width:calc(100vw - 32px)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.ok{background:var(--ok)} .toast.bad{background:var(--bad)}

/* ---------- Responsive ---------- */
@media (max-width:1180px){
  .compose{grid-template-columns:1fr}
  .guest{position:static}
  .dash-grid{grid-template-columns:1fr}
}
@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .side{position:sticky;top:0;height:auto;padding:10px 12px;z-index:30;flex-direction:column}
  .side-top{padding:0}
  .side .keytag{width:30px;height:40px;padding-bottom:5px}
  .side .keytag i{top:5px;width:7px;height:7px;margin-left:-3.5px}
  .menu-btn{display:inline-grid}
  .nav,.side-foot{display:none}
  .side.open .nav{display:grid;margin-top:10px}
  .side.open .side-foot{display:flex;margin-top:10px}
  .nav a.active::before{display:none}
  .main{padding:20px 16px 50px}
  .sig-layout{grid-template-columns:1fr}
  .sig-list{position:static}
  .sig-list ul{max-height:none}
  .tally{grid-template-columns:1fr 1fr}
  .tally>div:nth-child(3){border-inline-start:0}
  .tally>div:nth-child(n+3){border-top:1px solid var(--line-2)}
  .facts{grid-template-columns:1fr 1fr}
}
@media (max-width:600px){
  .grid2,.checks-list{grid-template-columns:1fr}
  .pagehead h1{font-size:26px}
  .panel{padding:16px}
  .tally .num{font-size:30px}
  .copybar .btn{flex:1}
  .filters select,.datef{flex:1 1 45%}
  .ledger{font-size:13.5px}
  .ledger th,.ledger td{padding:10px 12px}
  .sig-import{justify-content:flex-start}
  .toolbar{gap:2px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* OMRAN identity: midnight navy, clear blue and restrained brass. */
:root{
  --lobby:#142b4c; --lobby-2:#1d3d68; --lobby-3:#315987; --lobby-ink:#edf3fc; --lobby-muted:#b2c3dc;
  --bg:#f2f5fa; --card:#fff; --ink:#1a2a43; --muted:#65748d; --line:#dce4ef; --line-2:#e9eef5;
  --brass:#c6a45f; --brass-2:#a98542; --brass-soft:#f5eedc; --brass-ink:#413317;
  --ok:#315f9c; --ok-bg:#eaf1fb; --focus:0 0 0 3px rgba(49,95,156,.24);
}
.auth{background:radial-gradient(1100px 520px at 50% -10%,#315987 0%,#142b4c 58%,#0e1c32 100%)}
.auth-layout{width:min(1160px,100%);min-height:660px;display:grid;grid-template-columns:1.04fr .96fr;background:var(--card);border:1px solid #ffffff24;border-radius:26px;overflow:hidden;box-shadow:0 32px 90px #07152966}
.auth-hero{position:relative;min-height:660px;overflow:hidden;padding:34px 42px;color:#f5f8ff;background:radial-gradient(ellipse at 18% 95%,#315f96 0%,transparent 43%),linear-gradient(145deg,#101d35,#183b68 57%,#214b7d)}
.auth-hero::before,.auth-hero::after{content:"";position:absolute;border:1px solid #ffffff1d;border-radius:50%;pointer-events:none}
.auth-hero::before{width:420px;height:420px;right:-180px;top:105px;box-shadow:0 0 0 24px #ffffff08,0 0 0 52px #ffffff05}
.auth-hero::after{width:290px;height:290px;right:-115px;top:170px}
.auth-brand,.auth-copy,.auth-mail-card,.auth-bot,.auth-hero-foot{position:relative;z-index:2}
.auth-hero .brand b{font:500 16px/1.2 var(--serif);letter-spacing:.2em;color:#fff}
.auth-hero .brand small{color:#c9d8ed}
.auth-hero .keytag{width:42px;height:42px;border-radius:50%;place-items:center;padding:0;transform:none;background:linear-gradient(145deg,#f5e7c0,#c6a45f);box-shadow:0 7px 20px #07152966}
.auth-hero .keytag i{display:none}
.auth-hero .keytag span{font:500 22px/1 var(--serif);color:#183455}
.auth-copy{margin-top:82px;max-width:420px}
.auth-kicker,.auth-welcome{font-size:10px;letter-spacing:.16em;font-weight:700;color:#bfcee4}
.auth-copy h1{margin:12px 0 12px;font:500 40px/1.13 var(--serif);letter-spacing:-.03em;color:#f8faff}
.auth-copy h1 em{font-weight:400;color:#e7ce92}
.auth-copy p{max-width:380px;margin:0;color:#d5e1f1;font-size:14px;line-height:1.8}
.auth-mail-card{position:absolute;right:38px;bottom:134px;width:275px;padding:15px 16px 14px;border-radius:14px;background:#fff;color:#233754;box-shadow:0 20px 48px #07152970;transform:rotate(-3deg);animation:omran-mail-float 6s ease-in-out infinite}
.auth-mail-head{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.auth-mail-head span{width:8px;height:8px;border-radius:50%;background:#6a94c6}
.auth-mail-head i,.auth-mail-line{height:6px;border-radius:8px;background:#e5ebf4}
.auth-mail-head i{width:68px}.auth-mail-head b{margin-left:auto;color:#8b9ab0;letter-spacing:2px}
.auth-mail-card>strong{font-size:11px;color:#263d5f}
.auth-mail-line{width:68%;margin-top:8px}.auth-mail-line.long{width:100%}
.auth-mail-answer{display:flex;align-items:center;gap:9px;margin-top:14px;padding:9px;border-radius:9px;background:#edf3fb}
.auth-mail-answer>span{font-size:16px;color:#315f9c}.auth-mail-answer b,.auth-mail-answer small{display:block}
.auth-mail-answer b{font-size:10px}.auth-mail-answer small{margin-top:2px;font-size:9px;color:#70819a}.auth-mail-answer>i{margin-left:auto;font-style:normal;color:#315f9c;font-weight:800}
.auth-bot{position:absolute;left:42px;bottom:23px;width:160px;height:170px;animation:omran-bot-hover 4.2s ease-in-out infinite}
.bot-status{position:absolute;left:0;top:0;display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;background:#ffffffed;color:#244061;box-shadow:0 6px 18px #081a3340;font-size:9px;white-space:nowrap}
.bot-status i{width:7px;height:7px;border-radius:50%;background:#5f91cf;box-shadow:0 0 0 4px #5f91cf24}
.bot-antenna{position:absolute;left:76px;top:35px;width:2px;height:16px;background:#c6d8ed}
.bot-antenna i{position:absolute;left:-4px;top:-5px;width:10px;height:10px;border-radius:50%;background:#e4c987;box-shadow:0 0 12px #e4c98799;animation:omran-bot-signal 1.8s ease-in-out infinite}
.bot-head{position:absolute;left:43px;top:46px;width:72px;height:53px;border:2px solid #c9d9ec;border-radius:19px 19px 15px 15px;background:linear-gradient(145deg,#eef5ff,#afc7e5);box-shadow:0 9px 18px #06162e35;display:flex;align-items:center;justify-content:center;gap:12px}
.bot-head i{width:7px;height:9px;border-radius:50%;background:#183b68;box-shadow:0 0 7px #6ea0dc}.bot-head b{position:absolute;left:28px;bottom:10px;width:14px;height:4px;border-radius:8px;background:#6686ad}
.bot-body{position:absolute;left:52px;top:101px;width:55px;height:40px;border-radius:15px 15px 10px 10px;background:linear-gradient(145deg,#d6e5f7,#91aed1);border:2px solid #c9d9ec;display:grid;place-items:center;box-shadow:0 8px 15px #06162e30}
.bot-body span{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#183b68;color:#f2d894;font:12px var(--serif)}
.bot-arm{position:absolute;top:108px;width:24px;height:9px;border-radius:8px;background:#c1d4ea;transform-origin:top center}.bot-arm.left{left:34px;transform:rotate(28deg)}.bot-arm.right{left:102px;transform:rotate(-27deg);animation:omran-bot-type .38s ease-in-out infinite alternate}
.bot-laptop{position:absolute;left:101px;top:121px;width:54px;height:40px;transform:perspective(80px) rotateY(-7deg)}
.bot-laptop>div{position:absolute;left:4px;top:0;width:45px;height:29px;border:2px solid #dbe8f6;border-radius:5px 5px 2px 2px;background:#173457;padding:5px 4px;display:flex;flex-direction:column;gap:3px}
.bot-laptop>div i{height:2px;width:70%;border-radius:2px;background:#9ab7da;animation:omran-bot-text 1.2s steps(3,end) infinite}.bot-laptop>div i:nth-child(2){width:90%;animation-delay:.2s}.bot-laptop>div i:nth-child(3){width:55%;animation-delay:.4s}.bot-laptop>div b{position:absolute;right:5px;bottom:5px;width:2px;height:7px;background:#e4c987;animation:omran-bot-caret .8s steps(2,end) infinite}
.bot-laptop>span{position:absolute;left:0;top:29px;width:54px;height:5px;border-radius:1px 1px 7px 7px;background:linear-gradient(90deg,#91accd,#eaf2fb,#91accd)}
.auth-hero-foot{position:absolute;left:42px;right:42px;bottom:22px;display:flex;justify-content:space-between;gap:12px;color:#c4d3e8;font-size:10px}
.auth-main{display:flex;flex-direction:column;justify-content:center;padding:54px clamp(30px,5vw,66px);background:#fff}
.auth-main h2{margin:8px 0 7px;font:500 28px/1.2 var(--serif);color:#1b2c46}
.auth-main>p{margin:0 0 26px;font-size:13px}
.auth-main .field{gap:7px;font-size:13px}.auth-main input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]){min-height:46px;border-radius:9px;background:#fbfcfe}
.auth-form{gap:17px}.auth-form .btn{min-height:48px;justify-content:space-between;padding-inline:17px;border-radius:9px}
.auth-welcome{color:#7e8da5}.auth-main-foot{margin-top:24px;padding-top:17px;border-top:1px solid var(--line);color:var(--muted);font-size:11px}
.auth-mobile-brand{display:none}.auth-foot{color:#d5dfed;text-align:center}.auth-foot span{padding:0 4px;color:#dfc57e}.ui-language{display:inline-flex;align-items:center;padding:5px 10px;border-radius:99px;background:var(--brass-soft);color:var(--brass-ink);font-size:12px;font-weight:600}
.auth-main-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:34px}.auth-main-top .brand{display:none}
.language-picker select{min-width:112px;padding:7px 32px 7px 12px;border-radius:999px;background-color:#fff;font-size:13px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html[dir=rtl] .shell{direction:rtl}
html[dir=rtl] select{background-position:17px 55%,12px 55%;padding-inline:12px 32px}
html[dir=rtl] input[type=date]{direction:ltr;text-align:left}
html[dir=rtl] .sig-editor,html[dir=rtl] .sig-source{direction:ltr;text-align:left}
html[dir=rtl] .auth-main,html[dir=rtl] .auth-card{direction:rtl;text-align:right}
html[dir=rtl] .auth-mail-card{direction:rtl}
@keyframes omran-mail-float{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-7px) rotate(-1deg)}}
@keyframes omran-bot-hover{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
@keyframes omran-bot-type{from{transform:rotate(-27deg)}to{transform:rotate(-43deg)}}
@keyframes omran-bot-signal{0%,100%{opacity:.7;transform:scale(.9)}50%{opacity:1;transform:scale(1.15)}}
@keyframes omran-bot-text{0%{width:35%}50%{width:88%}100%{width:58%}}
@keyframes omran-bot-caret{0%,49%{opacity:1}50%,100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.auth-bot,.auth-mail-card,.bot-antenna i,.bot-arm.right,.bot-laptop>div i,.bot-laptop>div b{animation:none!important}}
@media(max-width:820px){.auth-layout{grid-template-columns:1fr;max-width:620px}.auth-hero{min-height:420px;padding:26px 28px}.auth-copy{margin-top:48px;max-width:380px}.auth-copy h1{font-size:34px}.auth-mail-card{right:20px;bottom:34px;width:235px}.auth-bot{left:20px;bottom:15px;transform:scale(.75);transform-origin:bottom left}.auth-hero-foot{display:none}.auth-main{padding:34px 30px 38px}.auth-mobile-brand{display:block;margin-bottom:30px}.auth-main h2{font-size:25px}.auth-foot{margin:0}.auth{padding:18px 12px;gap:12px}}
@media(max-width:390px){.auth-mail-card{right:12px;width:205px}.auth-bot{left:8px;transform:scale(.63);transform-origin:bottom left}}
@media(max-width:340px){.auth-bot{display:none}}
