/* What the mockup never had to draw: forms inside dialogs, the confirmation
 * dialog's buttons, a destructive button, toasts and the invitation link — in
 * the mockup's own tokens, so they read as part of it. Plus the seam where the
 * previous panel's pages sit inside the new frame. Nothing here restyles a
 * mockup component. */

/* The mockup ran inside a host page with no body margin; here it needs saying. */
body { margin: 0; }
/* The sign-in page's wrapper is a full-height block; gone once signed in. */
#loginWrap:has(> #login[hidden]) { display: none; }

/* ---- the previous panel's pages, inside the new frame ---- */
#s-legacy .legacy { background: none; min-height: 0; height: auto; display: block; }
#s-legacy .legacy main { padding: 0; max-width: none; }
#s-legacy .legacy .foot { padding: 12px 0 0; border: 0; background: none; }
#s-legacy .h1row .act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- dialogs ---- */
.dt-dialog {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 22px; max-width: 460px; width: calc(100vw - 32px);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / .8); font-family: var(--font);
}
.dt-dialog.cc-dialog:has(.tw) { max-width: 640px; }
.dt-dialog h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.dt-dialog .dt-dialog-body { font-size: 13px; color: var(--muted); line-height: 1.85; }
/* Primary action on the right (RTL rule, owner 2026-10-04). The DOM keeps
   cancel first so Enter in a confirm dialog still lands on the safe button;
   only the drawing order flips. row-reverse moves main-start to the left, so
   flex-end keeps the group on the right. */
.dt-dialog-foot { display: flex; flex-direction: row-reverse; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.dt-dialog .btn-primary { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.dt-dialog .btn-danger, .btn.danger { background: var(--bad); color: #1C0508; border-color: transparent; }
.btn.danger:hover, .dt-dialog .btn-danger:hover { filter: brightness(1.08); background: var(--bad); }
.dt-dialog .btn-quiet { background: none; }
.dt-dialog.danger h3 { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.pri:disabled { box-shadow: none; }

.ffs { display: grid; gap: 12px; margin-top: 14px; }
.ff { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ff > span small { color: var(--dim); font-weight: 400; }
.ff > small { color: var(--dim); font-size: 11.5px; }
.ff input, .ff select, .ff textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; font: inherit; font-size: 13.5px;
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.ff textarea { resize: vertical; min-height: 76px; line-height: 1.7; }
.ff input[dir="ltr"] { text-align: left; }
.ff input:focus, .ff select:focus, .ff textarea:focus { outline: 2px solid rgb(242 193 78 / .5); outline-offset: 1px; border-color: transparent; }
.dt-dialog .err { margin: 10px 0 0; min-height: 1em; color: var(--bad); font-size: 12.5px; }
.dt-dialog .err:empty { display: none; }

.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 14px; padding: 8px 10px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.linkbox code { flex: 1; min-width: 0; direction: ltr; text-align: left; overflow-wrap: anywhere; font-size: 12px; color: var(--gold); }

/* ---- filter dropdowns inside a mockup .field ---- */
.field select.sel0 { background: none; border: 0; color: var(--ink); font: inherit; font-size: 12.5px; padding: 0; cursor: pointer;
  appearance: none; field-sizing: content; width: auto; min-width: 0; max-width: 200px; }
.field select.sel0 option { background: var(--surface); color: var(--ink); }
.field input[type=checkbox] { margin: 0; }
a.btn { text-decoration: none; color: inherit; }

/* ---- the permission grid: a locked role cannot be clicked ---- */
.pmx .ck[aria-disabled="true"] { cursor: default; opacity: .7; }
.pmx .ck:focus-visible, .clickrows tr:focus-visible { outline: 2px solid rgb(242 193 78 / .6); outline-offset: 2px; }

/* ---- the person page's menu separators ---- */
.spmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---- toasts (live outside every page) ---- */
.toasts { position: fixed; inset-block-end: 20px; inset-inline-start: 20px; display: grid; gap: 8px; z-index: 1000; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 240px; max-width: min(420px, calc(100vw - 40px));
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / .8); font-size: 13px; }
.toast .ic { width: 18px; height: 18px; flex: none; }
.toast.ok .ic { color: var(--ok); } .toast.bad .ic { color: var(--bad); } .toast.warn .ic { color: var(--warn); }

/* ---- a search result that leads nowhere this person may go ---- */
.res.nogo { cursor: default; opacity: .7; }

/* ---- cards that open their section (home and dashboards) ---- */
.card[data-go], .dq[data-go] { cursor: pointer; transition: border-color .15s, background .15s; }
.card[data-go]:hover { border-color: var(--line-2); }
.dq[data-go]:hover { background: var(--surface-2); }
.card[data-go]:focus-visible, .dq[data-go]:focus-visible { outline: 2px solid rgb(242 193 78 / .6); outline-offset: 2px; }

/* ---- a card whose data arrives in a later phase: «—» and when ---- */
.kpi.empty .v { color: var(--dim); }
.kpi.empty .d, .dq.empty .qs { color: var(--dim); }
.ai.later { opacity: .72; }

/* 5c: an empty calendar day is a button (press to hold) */
.cal button.c{padding:0;font:inherit;cursor:pointer;display:block;width:100%;appearance:none;-webkit-appearance:none}
.cal button.c:hover,.cal button.c:focus-visible{border-color:var(--info);border-style:solid;outline:none;background:rgb(91 155 255 / .12)}
.cal .hd b{color:var(--ink)}
.ff .pdate{color:var(--gold)}
/* Ticket screenshots under a user's message (owner, 10-05: up to three). */
.tkfiles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tkfiles img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
/* A dashboard with five figures (users: + «ایمیل خبری», 10-05) keeps them on
   one row; on two columns the odd one spans the row instead of standing alone. */
.grid.g4.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.g4.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.g4.g5 > :nth-child(5) { grid-column: 1 / -1; } }
/* System messages (10-10): when a scheduled one starts, and the row that opens under a message. */
#tblMsgs td .sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
#tblMsgs tr.row-click { cursor: pointer; }
#tblMsgs tr.msg-detail-row > td { background: var(--bg-2); padding: 12px 16px; }
.msg-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 0; }
.msg-detail dt { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.msg-detail dd { margin: 0; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.msg-detail .ltr { direction: ltr; unicode-bidi: isolate; }

/* A letter's own HTML (mail-ui.js showFrame): white page like any mail client,
 * full width, as tall as the letter. */
.mframe { display: block; width: 100%; min-height: 160px; border: 0; border-radius: 12px; background: #fff; }
.mbody a { color: var(--gold, #F2C14E); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
