/* Mail on the house shell (Ilorb Omni panel: operachat.com.br/web/admin-html src/layout.ts + public/admin.css; worked
   no-build copy: ilorbboards/app/public/shell.css). opera.css is vendored as-is and never edited; this is the product
   layer on top of it: brand tokens for both themes, side menu, top bar, and the mail screens inside .body.
   Brand by host (brand.js sets html[data-brand]): Ilorb indigo on *.ilorb.*, Connecting blue elsewhere.
   Theme: html[data-theme] (brand.js, before first paint) mirrors the mail app's body.dark. */

/* ---- tokens ---- */
:root[data-theme="light"] {
  --bg:#f6f8fc; --card:#fff; --side:#fff; --line:#e3e8ef; --line2:#cfd6e0; --txt:#1f1f1f; --mut:#5f6368;
  --acc:#0b57d0; --acc-soft:rgba(11,87,208,.09); --bar:#0b57d0; --on-acc:#fff; --acc-line:rgba(11,87,208,.3); --acc-bg:rgba(11,87,208,.05);
  --hover:rgba(31,31,31,.04); --hover-btn:rgba(31,31,31,.07); --scroll:#cfd6e0;
}
:root[data-theme="dark"] {
  --bg:#1a1b1e; --card:#26272b; --side:#1f2023; --line:#3a3b40; --line2:#4a4b52; --txt:#e3e3e6; --mut:#9aa0a6;
  --acc:#a8c7fa; --acc-soft:rgba(168,199,250,.12); --bar:#a8c7fa; --on-acc:#062e6f; --acc-line:rgba(168,199,250,.35); --acc-bg:rgba(168,199,250,.08);
  --scroll:#3a3b40;
}
:root[data-brand="ilorb"][data-theme="light"] { --acc:#4338ca; --acc-soft:rgba(67,56,202,.08); --bar:#4f46e5; --acc-line:rgba(67,56,202,.28); --acc-bg:rgba(67,56,202,.05); }
:root[data-brand="ilorb"][data-theme="dark"] { --acc:#8b87ff; --acc-soft:rgba(139,135,255,.12); --bar:#8b87ff; --on-acc:#0e0c2b; --acc-line:rgba(139,135,255,.35); --acc-bg:rgba(139,135,255,.08); }
/* the mail screens keep their own names for the same colours */
:root[data-brand="ilorb"] body:not(.dark) { --blue:#4338ca; --pill:#e4e2fb; --pill-tx:#1e1b6b; --sel:#dcd9fb; --compose:#e4e2fb; --compose-tx:#1e1b6b; }
:root[data-brand="ilorb"] body.dark { --blue:#8b87ff; --pill:#2f2d5c; --pill-tx:#d6d4ff; --sel:#2f2d5c; }

body { font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; font-size:14px; line-height:normal; -webkit-font-smoothing:antialiased; }
input, select, textarea, button { font-family:inherit; }

/* ---- side menu ---- */
#app.shell { background:var(--bg); }
.side.nav { padding:0; }
.side .brand { gap:10px; padding:14px 14px 10px; color:var(--txt); }
.side .mark { width:30px; height:30px; flex:none; border-radius:9px; background:var(--acc-soft); color:var(--acc); display:inline-flex; align-items:center; justify-content:center; }
.side .mark .material-symbols-outlined { font-size:19px; }
.side .mark svg { width:20px; height:20px; }
.side .brand .lbl { font-weight:800; letter-spacing:-.3px; font-size:16px; line-height:1.15; min-width:0; }
.side .brand small:empty { display:none; }
.side .colbtn { display:inline-flex; align-items:center; justify-content:center; width:28px; padding:0; }
.side .colbtn .material-symbols-outlined { font-size:19px; }
#app.col .side .colbtn .material-symbols-outlined { transform:rotate(180deg); }
#app.col .side .brand { flex-direction:column; gap:6px; }

.side .compose-btn { height:40px; margin:6px 12px 10px; padding:0 16px 0 12px; gap:10px; border-radius:10px; background:var(--acc); color:var(--on-acc); font-size:14px; font-weight:600; box-shadow:none; }
.side .compose-btn:hover { box-shadow:none; filter:brightness(1.06); }
.side .nav-item { height:auto; min-height:32px; padding:6px 12px; margin:1px 8px; gap:10px; border-radius:8px; color:var(--mut); font-size:13.5px; font-weight:500; }
.side .nav-item .material-symbols-outlined { font-size:19px; opacity:.85; }
.side .nav-item:hover { background:var(--hover); color:var(--txt); }
.side .nav-item.active { background:var(--acc-soft); color:var(--acc); font-weight:600; }
.side .nav-item.active .material-symbols-outlined { opacity:1; }
.side .nav-item .nav-count { color:inherit; }
.side .nav-sec { padding:12px 20px 3px; font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.6px; color:var(--mut); }
.side .nav-sec-row { padding-right:12px; }
#app.col .side .nav-item { justify-content:center; padding:8px 0; margin:1px 8px; width:auto; gap:0; }
#app.col .side .compose-btn { width:40px; height:40px; margin:6px auto 10px; padding:0; justify-content:center; }
#app.col .side .brand .lbl, #app.col .side .foot .who, #app.col .side .nav-sec { display:none; }

.side .foot { display:flex; align-items:center; gap:9px; padding:10px 12px; }
.side .foot .who { flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.side .foot .who b { color:var(--txt); font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.side .foot .who small { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--mut); }
.side .foot .avatar { width:30px; height:30px; margin:0; font-size:12px; border:0; cursor:pointer; }
.side .foot .avatar-wrap { position:static; }
.side .foot .acct-menu { position:fixed; top:auto; right:auto; left:12px; bottom:58px; z-index:70; }
.linkbtn { background:none; border:0; height:28px; width:28px; padding:0; display:inline-flex; align-items:center; justify-content:center; color:var(--mut); border-radius:7px; cursor:pointer; }
.linkbtn:hover { color:var(--bad); background:var(--hover-btn); }
.linkbtn .material-symbols-outlined { font-size:18px; }
#app.col .side .foot { flex-direction:column; padding:10px 0; }

/* ---- top bar ---- */
.topbar { background:var(--card); gap:10px; }
.topbar .crumb { color:var(--mut); font-size:13px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .crumb b { color:var(--txt); font-weight:650; }
.topbar .crumb .sep { opacity:.5; margin:0 4px; }
.topbar .search { display:flex; align-items:center; gap:8px; width:380px; max-width:42vw; height:34px; padding:0 10px; border-radius:8px; background:var(--bg); color:var(--mut); border:1px solid transparent; }
.topbar .search:focus-within { background:var(--card); border-color:var(--line2); }
.topbar .search .material-symbols-outlined { font-size:18px; }
.topbar .search input { flex:1; min-width:0; border:0; background:transparent; outline:none; font-size:13.5px; color:var(--txt); padding:0; height:32px; }
.topbar .ctx { gap:6px; }
.topbar .icon-btn { width:34px; height:34px; border-radius:8px; color:var(--mut); }
.topbar .icon-btn .material-symbols-outlined { font-size:20px; }
.topbar .settings-wrap { position:relative; }
.topbar .menu { top:42px; }
.lang-sel { height:34px; padding:0 8px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--txt); font-size:13px; cursor:pointer; }
.tgl { height:34px; width:34px; padding:0; display:inline-flex; align-items:center; justify-content:center; background:var(--card); color:var(--txt); border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.tgl:hover, .lang-sel:hover { border-color:var(--line2); }
.tgl .material-symbols-outlined { font-size:18px; }
.burger { align-items:center; justify-content:center; border-radius:8px; cursor:pointer; }
.burger .material-symbols-outlined { font-size:20px; }

/* ---- content: the mail screens fill .body (the list and the reading pane scroll inside, like Omni's conversations);
        admin pages scroll in .body itself ---- */
.body.full { padding:0; overflow:hidden; }
.content[hidden], .admin-page[hidden] { display:none !important; }
.admin-page { width:100%; }
.admin-page .cab h3 { font-size:20px; }
.admin-page .admin-tabs { padding:0; margin:6px 0 16px; scrollbar-width:thin; overscroll-behavior-x:contain; scroll-snap-type:x proximity; scroll-behavior:smooth; }
.admin-page .atab { scroll-snap-align:start; flex:none; cursor:pointer; }
.admin-page .admin-body { padding:0; overflow-x:auto; overscroll-behavior-x:contain; }
.atab.active { color:var(--acc); border-bottom-color:var(--acc); }
.abtn { background:var(--acc); color:var(--on-acc); }

/* Orbit symbol in the side menu */
.side .mark .logo-ring { fill:none; stroke:var(--logo-ring); stroke-width:13; stroke-linecap:round; }
.side .mark .logo-orb { fill:var(--logo-orb); }

/* DEV flag: only on DEV hosts (brand.js sets html[data-env="dev"]) */
.dev-flag { display:none; }
:root[data-env="dev"] .dev-flag { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.06em; color:var(--warn); border:1px solid var(--warn-line); background:var(--warn-bg); border-radius:5px; padding:1px 6px; line-height:1.4; }
:root[data-env="dev"] .login-card .dev-flag { display:table; margin:6px auto 0; }

/* sign-in page: brand, language and theme (never a bare form).
   opera.css also styles the element #login (a 380 px bordered box, full-width inputs and buttons): our #login is the
   whole page, so those rules are undone here (ID specificity, so it must be #login …). */
#login { max-width:none; margin:0; background:none; border:0; border-radius:0; padding:0; }
#login .login-card input { width:100%; margin:7px 0; }
#login .login-card button#lg-btn { width:100%; margin:14px 0 0; justify-content:center; }
#login .login-tools button, #login .login-tools input { width:34px; margin:0; }
#login .login-tools .osel button.osel-btn.osel-btn { width:auto; min-width:58px; }
.login-wrap { position:relative; }
.login-tools { position:fixed; top:14px; right:14px; display:flex; gap:6px; z-index:5; }
.login-card .login-lockup { display:flex; justify-content:center; margin:0 0 4px; }
.login-card .login-lockup .ilorb-lockup { height:30px; }
.login-card .login-lockup .ilorb-divider { height:28px; }
.login-card .login-lockup .ilorb-product { font-size:24px; }
.login-card button#lg-btn { background:var(--acc); color:var(--on-acc); }
.login-card .mark.cm-only { background:var(--acc); }

/* complete filters above the mail list (wrap on narrow screens; on the phone behind the filter button) */
.filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px 12px; padding:8px 20px 10px; border-bottom:1px solid var(--line); background:var(--card); }
.filters .fl { display:flex; flex-direction:column; gap:3px; font-size:11px; color:var(--mut); text-transform:uppercase; letter-spacing:.4px; font-weight:600; }
.filters .fl input { height:32px; padding:0 9px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--txt); font-size:13px; text-transform:none; letter-spacing:0; font-weight:400; min-width:0; }
.filters .fl input[type=text] { width:200px; }
.filters .fl input:focus { outline:2px solid var(--acc); outline-offset:-1px; }
.filters .fl .osel { --osel-h:32px; --osel-font-size:13px; text-transform:none; letter-spacing:0; font-weight:400; }
.filters .fchk { display:inline-flex; align-items:center; gap:6px; height:32px; font-size:13px; color:var(--txt); cursor:pointer; }
.filters .fchk input { accent-color:var(--acc); width:16px; height:16px; margin:0; }
.filters .f-clear { height:32px; padding:0 12px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--txt); font-size:13px; cursor:pointer; }
.filters .f-clear:hover:not(:disabled) { border-color:var(--line2); }
.filters .f-clear:disabled { opacity:.5; cursor:default; }
.filters .f-count { margin-left:auto; align-self:center; font-size:12.5px; color:var(--mut); white-space:nowrap; }
/* reading a message: the filters belong to the list, not to the open e-mail */
.content:has(#read-view:not([hidden])) .filters { display:none !important; }
#btn-filters.on { color:var(--acc); background:var(--acc-soft); }
#btn-filters { display:none; }
@media (max-width: 820px) {
  #btn-filters { display:inline-flex; }
  .filters { display:none; padding:8px 12px 10px; }
  .filters.open { display:flex; }
  .filters .fl { flex:1 1 140px; }
  .filters .fl input[type=text] { width:100%; }
  .filters .f-count { margin-left:0; flex:1 1 100%; }
}

/* admin lists: the same complete filters, always visible (also on the phone), with "New …" at the end */
.afilters { padding:0 0 12px; border:0; background:none; margin-bottom:4px; }
.afilters .af-new { height:32px; display:inline-flex; align-items:center; gap:6px; padding:0 12px; border-radius:8px; border:0; cursor:pointer; font-size:13px; font-weight:600; }
.afilters .af-new .material-symbols-outlined { font-size:18px; }
.afilters .f-count { margin-left:auto; }
.atable a[data-edit] { color:var(--acc); font-weight:500; }
.atable .row-edit { display:inline-flex; color:var(--mut); }
.atable .row-acts { white-space:nowrap; text-align:right; }
.atable .empty-row { color:var(--mut); padding:18px 8px; }
@media (max-width: 820px) {
  .afilters { display:flex !important; padding:0 0 12px; }
  .afilters .af-new { flex:1 1 100%; justify-content:center; height:38px; }
}

/* create/edit screens (never a modal): full width, grouped fields, Save + Cancel */
.aform-page { width:100%; display:flex; flex-direction:column; gap:14px; }
.aform-page .af-title { margin:0; font-size:17px; font-weight:650; color:var(--txt); }
.af-group { margin:0; padding:14px 16px 6px; border:1px solid var(--line); border-radius:12px; background:var(--card); display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:4px 16px; }
.af-group legend { padding:0 6px; font-size:11px; font-weight:600; color:var(--mut); text-transform:uppercase; letter-spacing:.5px; }
.af-group label.f { display:flex; flex-direction:column; gap:5px; margin:0 0 12px; font-size:12px; font-weight:600; color:var(--mut); }
.af-group label.f input { height:38px; padding:0 11px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--txt); font-size:14px; font-weight:400; }
.af-group label.f input:focus { outline:2px solid var(--acc); outline-offset:-1px; }
.af-group label.f .osel { display:flex; width:100%; font-weight:400; }
.af-group .fchk { display:flex; align-items:flex-start; gap:8px; margin:0 0 12px; font-size:14px; color:var(--txt); cursor:pointer; }
.af-group .fchk input { accent-color:var(--acc); width:16px; height:16px; margin:2px 0 0; }
.af-group .fchk span { display:flex; flex-direction:column; gap:2px; }
.af-group .fchk small { font-size:12px; color:var(--mut); }
.aform-page .af-actions { display:flex; gap:8px; justify-content:flex-end; }
.aform-page .af-actions button { height:38px; padding:0 18px; border-radius:8px; font-size:14px; cursor:pointer; }
.aform-page .af-actions .abtn { border:0; font-weight:600; }
.aform-page .af-actions .f-clear { background:var(--card); color:var(--txt); border:1px solid var(--line); }
.aform-page .af-actions .f-clear:hover { border-color:var(--line2); }
.aform-page .err:empty { display:none; }
.aform-page .err { color:var(--bad); font-size:13.5px; }
@media (max-width: 820px) {
  .af-group { grid-template-columns:minmax(0, 1fr); }
  .aform-page .af-actions button { flex:1; }
}

/* house dropdown (opera-select) inside the mail screens */
.modal .osel, .cw-body .osel, .login-card .osel { display:flex; width:100%; margin:6px 0; }
.cw-body .osel { --osel-h:40px; --osel-input-bg:transparent; margin:0; }
.cw-body .osel > button.osel-btn.osel-btn { border-width:0 0 1px; border-radius:0; }
.atable .osel, .aform .osel { --osel-h:32px; --osel-font-size:13px; }
.topbar .osel, .login-tools .osel { --osel-h:34px; --osel-font-size:13px; }
.topbar .ctx .osel { min-width:0; }
.osel.rd-assign { padding:0; border:0; background:none; --osel-h:32px; --osel-font-size:13px; --osel-radius:16px; }
.osel.lang-sel { border:0; padding:0; background:none; height:auto; width:auto; flex:none; }
.osel.lang-sel > button.osel-btn.osel-btn { min-width:58px; }
, above everything; on desktop it starts right of the side menu */
.toast { z-index:90; }
@media (min-width: 821px) { .toast { left:calc(var(--sidew) + 24px); } }
.topbar .ctx .lang-sel { min-width:0; width:auto; }
body.dark .atable td, body.dark .toolbar, body.dark .msg { border-bottom-color:var(--line); }
:root[data-theme="dark"] { color-scheme:dark; }
:root[data-theme="light"] { color-scheme:light; }
body.dark .atable th { border-bottom-color:var(--line2); }

/* no sideways scroll for the page */
html, body { overflow-x:hidden; }

@media (max-width: 820px) {
  .topbar { padding:0 10px; gap:6px; }
  .topbar .crumb { display:none; }
  .topbar .search { flex:1 1 0; width:auto; min-width:0; max-width:none; }
  .topbar .ctx { flex:none; }
  .topbar .settings-wrap:has(> .icon-btn) { display:contents; }
  .topbar .ctx { margin-left:0; }
  .lang-sel { width:58px; padding:0 4px; }
  .side .foot .acct-menu { left:12px; bottom:58px; }
  .admin-page { padding:0; }
  body.dark .login-card { background:transparent; border:0; }
}

/* dark mode: the mail screens' fixed light fills (chips, notes, banners, dialogs, attachments) follow the theme */
body.dark .rd-att:hover { background:var(--nav-hover); }
body.dark .att-ic, body.dark .cw-att { background:#33343a; color:var(--tx); }
body.dark .att-ic.pdf { background:rgba(242,139,130,.14); color:#f28b82; }
body.dark .admin-note { background:var(--bg); color:var(--muted); }
body.dark .note { background:rgba(253,214,99,.10); border-color:rgba(253,214,99,.30); color:var(--tx); }
body.dark .dlg-icon { background:var(--acc-soft); color:var(--acc); }
body.dark .dlg-icon.danger { background:rgba(242,139,130,.14); color:#f28b82; }
body.dark .dlg-opt:has(input:checked) { background:var(--acc-soft); }
body.dark .chip { background:var(--acc-soft); color:var(--acc); }
body.dark .chip.domain, body.dark .achip.ok { background:rgba(129,201,149,.14); color:#81c995; }
body.dark .achip.no { background:rgba(242,139,130,.14); color:#f28b82; }
body.dark .install-banner, body.dark .purge-note, body.dark .spam-why, body.dark .vac-note, body.dark .img-banner { background:var(--surface); color:var(--tx); border-color:var(--line); }
body.dark #tf-secret { background:var(--bg) !important; color:var(--tx); }
body.dark .menu-item { color:var(--tx); }

/* DMARC p=none = monitoring only: a warning (amber), not an error */
.achip.warn { background:#fef7e0; color:#8a5a00; }
body.dark .achip.warn { background:rgba(253,214,99,.14); color:#fdd663; }

/* search: matched words in the results */
mark.hl { background:#fde68a; color:inherit; border-radius:3px; padding:0 1px; }
body.dark mark.hl { background:rgba(253,214,99,.32); color:var(--tx); }

/* own icons (public/icons.js, Lucide): the old .material-symbols-outlined spans now hold an inline SVG sized by font-size */
.material-symbols-outlined { box-sizing:content-box; display:inline-flex; align-items:center; justify-content:center; width:1em; height:1em; font-size:24px; line-height:1; flex:none; user-select:none; overflow:hidden; white-space:nowrap; font-style:normal; vertical-align:middle; }
.material-symbols-outlined:not([data-icon]) { color:transparent; } /* the old name never flashes as text before its SVG */
.material-symbols-outlined > svg { width:1em; height:1em; display:block; stroke-width:1.9; }
.m-star.on > svg, .rd-star.on > svg, [data-icon="star"].on > svg { fill:currentColor; }

/* confirmation dialog: "do not ask again" */
.ask-remember { display:flex; align-items:center; gap:8px; margin:6px 0 0; font-size:13px; color:var(--muted); cursor:pointer; }
.ask-remember input { width:16px !important; height:16px; margin:0 !important; accent-color:var(--acc); }

/* drag and drop onto the side menu */
.drag-ghost { position:fixed; top:-100px; left:-100px; padding:6px 12px; border-radius:8px; background:var(--acc); color:var(--on-acc); font-size:13px; font-weight:600; }
body.dragging-mail .side .nav-item.folder[data-folder="inbox"], body.dragging-mail .side .nav-item.folder[data-folder="archive"],
body.dragging-mail .side .nav-item.folder[data-folder="trash"], body.dragging-mail .side .nav-item.folder[data-folder="spam"],
body.dragging-mail .side .cfolder, body.dragging-mail .side .label-item { outline:1px dashed var(--line2); outline-offset:-1px; }
.side .nav-item.drop-ok { background:var(--acc-soft); color:var(--acc); outline:2px solid var(--acc) !important; }
