/* MIZANIX v2.2 — user form, restaurants & branches, detailed schedule, maintenance, install. Uses the design tokens of styles.css. */

/* ── add-employee form ── */
.uf { display: grid; gap: 14px; }
.uf-step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.uf-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--latin); font-weight: 800; color: #fff; background: var(--grad-btn); box-shadow: 0 6px 16px -8px rgba(47,107,255,.9); }
.uf-body h4 { margin: 4px 0 12px; font-family: var(--display); font-size: 15px; color: var(--heading); }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.role-card { position: relative; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 4px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .15s; }
.role-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card .rc-ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); }
.role-card .rc-t { font-weight: 700; color: var(--heading); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.role-card .rc-t em { font-style: normal; font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-t); }
.role-card .rc-d { font-size: 12px; color: var(--muted); line-height: 1.7; }
.role-card:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 4px var(--focus); }
.role-card:has(input:checked) .rc-ic { background: var(--grad-btn); color: #fff; }
.role-card.rec { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border-color: transparent; }
.scope-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-t); font-size: 13.5px; }
.uf-adv { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 12px 14px; }
.uf-adv summary { cursor: pointer; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; list-style: none; }
.uf-adv summary::-webkit-details-marker { display: none; }

/* ── restaurants & branches ── */
.st-list { display: grid; gap: 16px; }
.st-card { padding: 20px 22px; }
.st-card.off { opacity: .6; }
.st-head { display: flex; align-items: center; gap: 14px; }
.st-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--grad-btn); color: #fff; box-shadow: 0 10px 22px -12px rgba(47,107,255,.9); }
.st-ic svg { width: 24px; height: 24px; }
.st-title { flex: 1; min-width: 0; }
.st-title h3 { margin: 0; font-family: var(--display); font-size: 18px; }
.st-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.st-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.st-facts > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.st-facts dt { font-size: 11.5px; color: var(--dim); margin-bottom: 3px; }
.st-facts dd { margin: 0; font-weight: 600; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.st-branches { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }

/* ── schedule / obligations ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 14px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.toolbar .input { width: auto; min-width: 150px; flex: 0 1 190px; height: 40px; padding: 0 12px; }
.toolbar #fq { flex: 1 1 220px; }
.toolbar .sp { flex: 1; }
.kpi-bad .k-ico { background: var(--bad-bg); color: var(--bad); } .kpi-bad::before { background: var(--bad); }
.kpi-warn .k-ico { background: var(--warn-bg); color: var(--warn); } .kpi-warn::before { background: var(--warn); }
.kpi-ok .k-ico { background: var(--ok-bg); color: var(--ok); } .kpi-ok::before { background: var(--ok); }
.cat-strip { margin-top: 16px; }
.cat-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.cb { display: grid; grid-template-columns: 130px 1fr auto 26px; align-items: center; gap: 10px; font-size: 13px; }
.cb span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb i { height: 8px; border-radius: 99px; background: var(--surface-3); position: relative; overflow: hidden; }
.cb i::after { content: ''; position: absolute; inset: 0; width: var(--w); border-radius: 99px; background: var(--grad-btn); }
.cb em { font-style: normal; font-size: 11px; color: var(--dim); text-align: center; background: var(--surface-3); border-radius: 99px; }
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ob-card { display: block; color: inherit; padding: 16px 18px; border-inline-start: 3px solid transparent; transition: transform .15s, box-shadow .2s; }
.ob-card:hover { transform: translateY(-2px); }
.ob-card.is-over { border-inline-start-color: var(--bad); } .ob-card.is-soon { border-inline-start-color: var(--warn); } .ob-card.off { opacity: .55; }
.ob-card h3 { margin: 12px 0 2px; font-size: 16px; font-family: var(--display); }
.ob-where { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ob-amt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 12px 0 10px; }
.ob-amt b { font-size: 21px; color: var(--heading); }
.ob-amt span { font-size: 12px; color: var(--dim); }
.ob-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.ob-facts dt { font-size: 11px; color: var(--dim); } .ob-facts dd { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.total-row td { font-weight: 800; background: var(--surface-2); color: var(--heading); }
.ofm { display: grid; gap: 14px; }
.ofm fieldset { margin: 0; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; background: var(--surface-2); }
.ofm legend { padding: 0 8px; font-weight: 700; font-family: var(--display); font-size: 14px; color: var(--heading); display: flex; gap: 8px; align-items: center; }
.ofm legend svg { color: var(--blue); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-pick label { cursor: pointer; }
.chips-pick input { position: absolute; opacity: 0; pointer-events: none; }
.chips-pick span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; background: var(--surface); transition: all .15s; }
.chips-pick input:checked + span { background: var(--grad-btn); color: #fff; border-color: transparent; }
.sticky-actions { position: sticky; bottom: -22px; margin: 0 -24px -22px; padding: 14px 24px; background: var(--elev); border-top: 1px solid var(--line); z-index: 2; }

/* ── maintenance ── */
#maint { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 600px at 50% 0%, #142a6b 0%, #070d2b 55%, #040817 100%); color: #eaf0ff; animation: fade .4s; }
body.in-maint { overflow: hidden; }
.mt-card { width: min(520px, 100%); text-align: center; }
.mt-rings { position: relative; width: 150px; height: 150px; margin: 0 auto 22px; display: grid; place-items: center; }
.mt-rings img { width: 84px; filter: drop-shadow(0 0 24px rgba(47,107,255,.8)); }
.mt-rings i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #19d3f5; animation: spin 2.4s linear infinite; }
.mt-rings i:nth-child(2) { inset: 12px; border-top-color: transparent; border-inline-start-color: #7b3ff2; animation-duration: 3.4s; animation-direction: reverse; }
.mt-rings i:nth-child(3) { inset: 24px; border-top-color: rgba(47,107,255,.8); animation-duration: 4.6s; }
#maint h1 { font-family: var(--display); font-size: clamp(22px, 5vw, 30px); margin: 0 0 10px; color: #fff; }
#maint p { color: #b8c6ee; line-height: 1.9; margin: 0 0 22px; }
.mt-eta { display: inline-grid; gap: 2px; padding: 14px 26px; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.mt-eta span { font-size: 12px; color: #9fb0e0; } .mt-eta b { font-family: var(--latin); font-size: 30px; color: #fff; } .mt-eta em { font-style: normal; font-size: 13px; color: #6ff2c3; }
.mt-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin: 26px auto 10px; width: min(320px, 80%); }
.mt-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, #19d3f5, #7b3ff2); animation: mtbar 1.8s ease-in-out infinite; }
@keyframes mtbar { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
.mt-foot { font-size: 12px; color: #8191c3; }
#maintstrip { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; font-size: 13px; font-weight: 600; background: var(--violet-bg); color: var(--violet-t); border-bottom: 1px solid var(--line); text-align: center; }
#maintstrip.adm { background: var(--warn-bg); color: var(--warn-t); }
#maintstrip a { color: inherit; text-decoration: underline; }
.steps-ol { margin: 0 0 12px; padding-inline-start: 20px; line-height: 2.1; }
.app-card .row { margin-top: 6px; }

/* ── phone polish ── */
@media (max-width: 860px) {
  .st-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-bars { grid-template-columns: 1fr; }
  .cb { grid-template-columns: 96px 1fr auto 24px; }
  .toolbar { padding: 10px; }
  .toolbar .input, .toolbar #fq { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .toolbar #fq { flex-basis: 100%; }
  .toolbar .sp { display: none; }
  .toolbar .btn { flex: 1 1 auto; }
  .uf-step { grid-template-columns: 1fr; padding: 14px; }
  .uf-n { width: 28px; height: 28px; font-size: 13px; }
  .role-cards { grid-template-columns: 1fr; }
  .ob-grid { grid-template-columns: 1fr; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.g4 .kpi { padding: 14px; }
  .grid.g4 .kpi .k-val { font-size: 19px; }
  .grid.g4 .kpi .k-ico { width: 32px; height: 32px; top: 12px; inset-inline-end: 12px; }
  .grid.g4 .kpi .k-label { font-size: 12px; padding-inline-end: 34px; }
  .modal { padding: 18px 16px; border-radius: 18px 18px 0 0; align-self: end; max-height: 94vh; }
  .modal-bg { padding: 0; align-items: end; }
  .sticky-actions { margin: 0 -16px -18px; padding: 12px 16px; }
  .st-head .btn { padding: 6px 10px; }
}

/* phones: never scroll sideways; the closed drawer is fully hidden (it used to create RTL overflow) */
@media (max-width: 860px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .shell { overflow-x: clip; }
  .side:not(.open) { visibility: hidden; pointer-events: none; }
  .side { transition: transform .3s ease, visibility 0s linear .3s; }
  .side.open { transition: transform .3s ease, visibility 0s; }
  .main { min-width: 0; width: 100%; }
}
.st-list, .arch-list, .stack { grid-template-columns: minmax(0, 1fr); }
.st-list > *, .ob-grid > *, .grid > *, .card { min-width: 0; }
.table-wrap { max-width: 100%; }

/* colourful navigation: each section keeps its own colour */
.nav a .ni { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 26%, transparent); transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.nav a .ni svg { width: 17px; height: 17px; }
.nav a:hover .ni { transform: scale(1.06); background: color-mix(in srgb, var(--c) 26%, transparent); }
.nav a.on { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), color-mix(in srgb, var(--c) 6%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
body[dir="rtl"] .nav a.on { background: linear-gradient(270deg, color-mix(in srgb, var(--c) 22%, transparent), color-mix(in srgb, var(--c) 6%, transparent)); }
.nav a.on .ni { background: var(--c); color: #fff; box-shadow: 0 6px 16px -6px var(--c); }
.nav a.on::before { background: var(--c); }
.side { background: linear-gradient(180deg, #0a1338 0%, #0c1745 45%, #120f3d 100%); }
.side .brand .bt { background: linear-gradient(90deg, #ffffff, #d6c48a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-group { color: #c9b77a; opacity: .75; }

/* ── messaging ── */
.chat { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; height: calc(100vh - 116px); }
.chat-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 0; }
.cl-head { display: flex; align-items: center; justify-content: space-between; }
.cl-head h3 { margin: 0; }
.tl { overflow: auto; display: grid; gap: 4px; align-content: start; min-height: 0; flex: 1; }
.tl-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 13px; color: var(--text); transition: background .15s; }
.tl-item:hover { background: var(--hover); }
.tl-item.on { background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.tl-item .avatar { width: 42px; height: 42px; }
.avatar.grp { background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.tl-txt { min-width: 0; display: grid; }
.tl-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-txt span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-end { display: grid; justify-items: end; gap: 4px; }
.tl-end em { font-style: normal; font-size: 11px; color: var(--dim); font-family: var(--latin); }
.chat-main { padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-empty { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px; color: var(--muted); }
.chat-empty svg { width: 54px; height: 54px; opacity: .35; }
.cm-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cm-title { flex: 1; min-width: 0; display: grid; }
.cm-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-back { display: none; }
.cm-msgs { flex: 1; overflow: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 8px; background:
  radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--blue) 5%, transparent), transparent 70%), var(--surface-2); }
.day-sep { text-align: center; margin: 8px 0; } .day-sep span { font-size: 11.5px; padding: 3px 12px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.sys-msg { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; color: var(--muted); }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; max-width: 82%; }
.bubble-row.me { align-self: flex-start; flex-direction: row; }
.bubble-row:not(.me) { align-self: flex-end; flex-direction: row-reverse; }
body[dir="ltr"] .bubble-row.me { align-self: flex-end; } body[dir="ltr"] .bubble-row:not(.me) { align-self: flex-start; }
.bubble { padding: 9px 13px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16,28,72,.06); min-width: 70px; animation: pop .2s ease; }
.bubble-row.me .bubble { background: var(--grad-btn); color: #fff; border-color: transparent; border-end-start-radius: 6px; }
.bubble-row:not(.me) .bubble { border-end-end-radius: 6px; }
.bubble.ment { box-shadow: 0 0 0 2px var(--warn); }
.bubble.del { opacity: .6; }
.b-from { font-size: 11.5px; font-weight: 700; color: var(--blue); margin-bottom: 2px; }
.b-body { line-height: 1.75; overflow-wrap: anywhere; }
.bubble-row.me .b-body a { color: #fff; text-decoration: underline; }
.b-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 10.5px; opacity: .7; margin-top: 2px; font-family: var(--latin); }
.b-del { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; opacity: .6; display: inline-grid; } .b-del svg { width: 12px; height: 12px; }
.mention { font-weight: 700; padding: 0 4px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 22%, transparent); }
.bubble-row.me .mention { background: rgba(255,255,255,.22); }
.bubble .file-chip { margin-top: 6px; }
.cm-compose { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.cm-compose textarea { flex: 1; border: 1px solid var(--line-2); border-radius: 18px; padding: 10px 14px; resize: none; outline: none; background: var(--input-bg); color: var(--text); max-height: 160px; line-height: 1.6; }
.cm-compose textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--focus); }
.cm-compose .send { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.cm-files { padding: 0 12px 8px; display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface); }
.mention-pop { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 12px; width: min(320px, 90%); background: var(--elev); border-radius: 14px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-2) inset; padding: 6px; z-index: 5; }
.mention-pop button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--text); text-align: start; }
.mention-pop button:hover { background: var(--hover); }
.people { display: grid; gap: 4px; max-height: 55vh; overflow: auto; margin-top: 10px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text); text-align: start; width: 100%; }
.person:hover { background: var(--hover); border-color: var(--line); }
.person > span:last-child { display: grid; }
.people.pick input { width: 17px; height: 17px; accent-color: var(--blue); }

/* ── tasks ── */
.task-card { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-inline-start: 3px solid var(--violet); text-align: start; }
.task-card.st-DONE { border-inline-start-color: var(--ok); } .task-card.late { border-inline-start-color: var(--bad); }
.tc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; align-items: center; }
.tc-meta svg { width: 13px; height: 13px; vertical-align: -2px; }
.tc-due { font-size: 12px; font-weight: 700; margin-top: 4px; color: var(--warn-t); }
.task-card.late .tc-due { color: var(--bad-t); }
.task-list { display: grid; gap: 10px; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border-inline-start: 3px solid var(--violet); }
.task-row.st-DONE { border-inline-start-color: var(--ok); opacity: .85; } .task-row.late { border-inline-start-color: var(--bad); } .task-row.st-CANCELLED { opacity: .55; border-inline-start-color: var(--line-strong); }
.task-row h3 { margin: 0; font-size: 15.5px; }
.task-row p { margin: 6px 0 0; }
.tr-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 92px); }
  .chat:not(.has-open) .chat-main { display: none; }
  .chat.has-open .chat-list { display: none; }
  .cm-back { display: inline-flex; }
  .bubble-row { max-width: 92%; }
  .task-row { grid-template-columns: 1fr; }
  .tr-act { justify-content: flex-start; }
}

/* ── AI credit forecast ── */
.credit .cr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.credit .cr-head h3 { margin: 0; }
.cr-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 14px; }
.cr-gauge { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 26px;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%), conic-gradient(var(--tone, var(--blue)) calc(var(--p) * 1%), var(--surface-3) 0); }
.credit.ok { --tone: var(--ok); } .credit.warn { --tone: var(--warn); } .credit.bad { --tone: var(--bad); }
.cr-gauge b { display: block; font-family: var(--display); font-size: 18px; color: var(--heading); line-height: 1.5; }
.cr-gauge span { font-size: 12px; color: var(--muted); }
.cr-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.cr-chart { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 16px; direction: ltr; }
.cr-chart .cc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.cr-chart i { width: 100%; max-width: 26px; height: var(--h); border-radius: 6px 6px 2px 2px; background: var(--grad-btn); }
.cr-chart span { font-size: 10px; color: var(--dim); font-family: var(--latin); }
.cr-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin: 16px 0 6px; }
@media (max-width: 860px) { .cr-grid { grid-template-columns: 1fr; } .cr-gauge { width: 200px; margin: 0 auto; } .cr-facts { grid-template-columns: 1fr 1fr; } .cr-form { grid-template-columns: 1fr; } }

/* ── AI actions & approvals ── */
.act-card { margin-top: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); border-inline-start: 4px solid var(--warn); }
.act-card.st-EXECUTED { border-inline-start-color: var(--ok); } .act-card.st-REJECTED, .act-card.st-FAILED { border-inline-start-color: var(--bad); } .act-card.st-CANCELLED { opacity: .6; border-inline-start-color: var(--line-strong); }
.ac-head { display: flex; align-items: center; gap: 10px; }
.ac-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--violet-bg); color: var(--violet); flex: none; }
.ac-t { flex: 1; display: grid; }
.ac-sum { margin: 10px 0; font-weight: 600; line-height: 1.8; color: var(--heading); }
.ac-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ac-nums > div { padding: 9px 11px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 2px; }
.ac-nums span { font-size: 11.5px; color: var(--dim); } .ac-nums b { font-size: 14.5px; color: var(--heading); }
.ac-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.ac-done { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ok-t); background: var(--ok-bg); padding: 10px 12px; border-radius: 12px; font-size: 13px; margin-top: 8px; }
.ap-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ap-list { display: grid; gap: 4px; }
.switch { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { grid-row: 1 / 3; width: 46px; height: 26px; border-radius: 99px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { inset-inline-start: 23px; }
@media (max-width: 860px) { .ac-nums { grid-template-columns: 1fr 1fr; } }

/* ── post-login welcome ── */
#welcome { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; color: #eef3ff; background: radial-gradient(ellipse at 50% 35%, #12256a 0%, #070e30 55%, #03060f 100%); opacity: 0; transition: opacity .6s ease, filter .7s ease; overflow: hidden; }
#welcome.in { opacity: 1; } #welcome.out { opacity: 0; filter: blur(8px); }
.wl-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.wl-aurora { position: absolute; inset: -20%; filter: blur(80px); opacity: .55; pointer-events: none; }
.wl-aurora i { position: absolute; border-radius: 50%; animation: drift 14s ease-in-out infinite alternate; }
.wl-aurora i:nth-child(1) { width: 40%; height: 40%; left: 8%; top: 12%; background: #2563eb; }
.wl-aurora i:nth-child(2) { width: 36%; height: 36%; right: 6%; top: 24%; background: #7c3aed; animation-duration: 18s; }
.wl-aurora i:nth-child(3) { width: 30%; height: 30%; left: 34%; bottom: 0; background: #b8932f; opacity: .55; animation-duration: 22s; }
.wl-stage { position: relative; display: grid; justify-items: center; gap: 18px; padding: 24px; text-align: center; max-width: 760px; }
.wl-logo { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.wl-logo img { width: 96px; filter: drop-shadow(0 0 30px rgba(80,140,255,.85)); animation: wlLogo 1.2s cubic-bezier(.2,.9,.2,1) both; }
.wl-logo i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; animation: spin 6s linear infinite; }
.wl-logo .r1 { border-top-color: #5fe3fb; } .wl-logo .r2 { inset: 14px; border-inline-start-color: #a78bfa; animation-duration: 9s; animation-direction: reverse; } .wl-logo .r3 { inset: -14px; border-bottom-color: rgba(214,196,138,.8); animation-duration: 13s; }
@keyframes wlLogo { from { opacity: 0; transform: scale(.4) rotate(-30deg); filter: blur(10px); } to { opacity: 1; transform: none; } }
.wl-lines { display: grid; gap: 8px; min-height: 230px; align-content: start; }
.wl-l { margin: 0; font-family: var(--display); font-size: clamp(17px, 3.4vw, 24px); color: #d9e3ff; opacity: 0; transform: translateY(18px); filter: blur(8px); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.9,.2,1), filter .7s ease; }
.wl-l.on { opacity: 1; transform: none; filter: none; }
.wl-l b { background: linear-gradient(90deg, #7fd8ff, #c4b5fd 60%, #e9d79a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wl-l.hero { font-size: clamp(30px, 7vw, 54px); font-weight: 800; color: #fff; text-shadow: 0 0 34px rgba(95,165,255,.6); margin-bottom: 6px; letter-spacing: .01em; }
.wl-l.soft { color: #a9b8e8; font-size: clamp(14px, 2.6vw, 18px); }
.wl-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.wl-chips span { font-family: var(--latin); font-weight: 700; padding: 6px 16px; border-radius: 999px; border: 1px solid rgba(214,196,138,.45); color: #f1e3b3; background: rgba(214,196,138,.08); opacity: 0; transform: translateY(10px) scale(.9); transition: all .5s cubic-bezier(.2,.9,.2,1); transition-delay: calc(var(--i) * 90ms); }
#welcome.chips-on .wl-chips span { opacity: 1; transform: none; }
.wl-go { margin-top: 6px; height: 50px; padding: 0 34px; border: 0; border-radius: 999px; font-weight: 800; font-size: 16px; color: #0b1640; cursor: pointer; background: linear-gradient(90deg, #f3e3a8, #d6b45a); box-shadow: 0 14px 34px -14px rgba(214,180,90,.9); opacity: 0; transform: translateY(12px); transition: all .5s ease; }
#welcome.go-on .wl-go { opacity: 1; transform: none; }
.wl-go:hover { filter: brightness(1.06); transform: translateY(-2px); }
.wl-skip { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; height: 40px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(10,18,48,.6); color: #dfe7ff; cursor: pointer; backdrop-filter: blur(8px); }
.wl-skip b { font-family: var(--latin); font-weight: 600; color: #9fb0e0; font-size: 12px; margin-inline-start: 6px; }

/* ── login: luxury motion ── */
.lg-card { position: relative; padding: 34px 32px; border-radius: 26px; background: var(--surface); box-shadow: 0 30px 80px -36px rgba(16,28,72,.45); isolation: isolate; }
.lg-card::before { content: ''; position: absolute; inset: -1.5px; border-radius: 27px; padding: 1.5px; z-index: -1; background: conic-gradient(from var(--ang, 0deg), #19d3f5, #2f6bff, #7b3ff2, #d6b45a, #19d3f5); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ring 6s linear infinite; opacity: .85; }
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes ring { to { --ang: 360deg; } }
.lg-card h1 { background: linear-gradient(90deg, var(--heading), #4b3cf0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-card .lead { animation: fadeUp .7s .1s ease both; } .lg-card form { animation: fadeUp .7s .2s ease both; } .lg-card h1 { animation: fadeUp .7s ease both; }
.lg-greet { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.lg-greet i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.2); animation: blink 2s infinite; }
.lg-orb { position: relative; width: 120px; height: 120px; display: grid; place-items: center; margin: 4px 0 18px; }
.lg-orb img { width: 76px; filter: drop-shadow(0 0 24px rgba(80,140,255,.8)); animation: float 6s ease-in-out infinite; }
.lg-orb i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: #5fe3fb; animation: spin 7s linear infinite; }
.lg-orb i + i { inset: 12px; border-top-color: transparent; border-inline-start-color: #a78bfa; animation-duration: 10s; animation-direction: reverse; }
.lg-float { position: absolute; z-index: 0; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); font-size: 12.5px; color: #dfe8ff; display: flex; align-items: center; gap: 10px; box-shadow: 0 16px 40px -20px rgba(0,0,0,.6); animation: floaty 7s ease-in-out infinite; }
.lg-float b { display: block; color: #fff; font-size: 13px; } .lg-float em { font-style: normal; color: #9fb0e0; font-size: 11.5px; }
.lg-float .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.lg-float.f1 { top: 18%; inset-inline-end: 7%; } .lg-float.f2 { top: 46%; inset-inline-end: 3%; animation-delay: -2.5s; } .lg-float.f3 { bottom: 20%; inset-inline-end: 12%; animation-delay: -4.5s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (max-width: 1200px) { .lg-float { display: none; } }
@media (max-width: 960px) { .lg-card { padding: 26px 20px; box-shadow: none; } }

/* ── login v3: richer card + phone hero ── */
.lg-panel { position: relative; overflow: hidden; isolation: isolate; }
.lg-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lg-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; animation: drift 16s ease-in-out infinite alternate; }
.lg-bg i:nth-child(1) { width: 380px; height: 380px; top: -120px; inset-inline-start: -80px; background: #60a5fa; }
.lg-bg i:nth-child(2) { width: 320px; height: 320px; bottom: -100px; inset-inline-end: -60px; background: #a78bfa; animation-duration: 20s; }
.lg-bg i:nth-child(3) { width: 220px; height: 220px; top: 40%; inset-inline-end: 30%; background: #f0d68a; opacity: .22; animation-duration: 24s; }
.lg-bg .lg-grid { position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--blue) 22%, transparent) 1px, transparent 1px); background-size: 22px 22px; mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%); opacity: .5; }
:root[data-theme="dark"] .lg-bg i { opacity: .22; }
.lg-mhero { display: none; }
.lg-card { backdrop-filter: blur(14px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.lg-card .fld .in { height: 54px; border-radius: 16px; background: var(--surface-2); border-color: var(--line); transition: border-color .2s, box-shadow .25s, background .2s; }
.lg-card .fld .in:hover { border-color: var(--line-strong); }
.lg-card .fld .in:focus { background: var(--input-bg); border-color: transparent; box-shadow: 0 0 0 2px var(--blue), 0 0 0 7px var(--focus), 0 12px 28px -16px rgba(47,107,255,.6); }
.lg-card .fld > svg { inset-inline-start: 12px; width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--blue-bg); color: var(--blue); }
.lg-card .fld .in { padding-inline-start: 52px; }
.lg-card .lg-label { font-size: 12.5px; letter-spacing: .01em; }
.lg-btn { height: 56px; border-radius: 16px; font-size: 16px; letter-spacing: .02em; background: linear-gradient(110deg, #2f6bff, #4b3cf0 45%, #7b3ff2 75%, #a855f7); background-size: 200% 100%; animation: btnflow 6s ease infinite; }
@keyframes btnflow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.lg-note { border-radius: 14px; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--blue) 6%, var(--surface-2))); }
.lg-orb { margin-inline: auto; }
.lg-card #step1 { text-align: center; }
.lg-card #step1 form, .lg-card #step1 .lg-note, .lg-card #step1 .lg-sep { text-align: start; }
.lg-card h1 { font-size: 30px; }

@media (max-width: 960px) {
  .lg-panel { justify-content: flex-start; padding: 0 0 28px; background: linear-gradient(180deg, #071038 0%, #0d1b55 34%, var(--bg) 34.1%); min-height: 100dvh; }
  .lg-bg i:nth-child(1) { top: -140px; opacity: .45; } .lg-bg i:nth-child(2) { top: 80px; bottom: auto; opacity: .35; } .lg-bg i:nth-child(3) { display: none; }
  .lg-bg .lg-grid { background-image: radial-gradient(rgba(150,180,255,.25) 1px, transparent 1px); mask-image: linear-gradient(180deg, #000 0%, transparent 36%); opacity: .6; }
  .lg-mhero { display: grid; justify-items: center; gap: 6px; padding: max(34px, env(safe-area-inset-top)) 20px 26px; color: #fff; text-align: center; }
  .lg-mlogo { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
  .lg-mlogo img { width: 70px; filter: drop-shadow(0 0 22px rgba(95,165,255,.85)); animation: float 6s ease-in-out infinite; }
  .lg-mlogo i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: #5fe3fb; animation: spin 6s linear infinite; }
  .lg-mlogo i + i { inset: 10px; border-top-color: transparent; border-inline-start-color: #c4b5fd; animation-duration: 9s; animation-direction: reverse; }
  .lg-mword { font-family: var(--latin); font-weight: 800; letter-spacing: .28em; padding-inline-start: .28em; font-size: 24px; text-shadow: 0 0 24px rgba(95,165,255,.6); }
  .lg-mtag { font-family: var(--display); font-size: 12.5px; color: #b8c6ee; }
  .lg-card { width: calc(100% - 28px); margin: 0 auto; padding: 26px 20px 22px; border-radius: 26px; background: var(--surface); box-shadow: 0 24px 60px -28px rgba(11,22,64,.55); }
  .lg-card .brand-sm, .lg-card .lg-orb { display: none; }
  .lg-card h1 { font-size: 25px; }
  .lg-foot { position: static; margin-top: 18px; justify-content: center; }
}
/* performance: soft glows without heavy blur filters (smooth on phones) */
.lg-bg i { filter: none !important; background: radial-gradient(circle, var(--g) 0%, transparent 68%) !important; opacity: .5; }
.lg-bg i:nth-child(1) { --g: rgba(96,165,250,.55); } .lg-bg i:nth-child(2) { --g: rgba(167,139,250,.5); } .lg-bg i:nth-child(3) { --g: rgba(240,214,138,.45); }
.lg-card { backdrop-filter: none; }
.wl-aurora { filter: none; } .wl-aurora i { background: radial-gradient(circle, var(--g) 0%, transparent 65%) !important; }
.wl-aurora i:nth-child(1) { --g: rgba(37,99,235,.7); } .wl-aurora i:nth-child(2) { --g: rgba(124,58,237,.6); } .wl-aurora i:nth-child(3) { --g: rgba(184,147,47,.45); }
.lg-mesh { filter: none; } .lg-mesh i { background: radial-gradient(circle, var(--g) 0%, transparent 65%) !important; }
.lg-mesh i:nth-child(1) { --g: rgba(29,78,216,.85); } .lg-mesh i:nth-child(2) { --g: rgba(109,40,217,.75); } .lg-mesh i:nth-child(3) { --g: rgba(8,145,178,.6); }
@media (max-width: 960px) { .top { backdrop-filter: none; background: var(--surface); } }
/* calendar: day picker + agenda, compact on phones */
.cal .dname .short { display: none; }
.cal .day { cursor: pointer; position: relative; }
.cal .day.sel { border-color: var(--violet, #7c3aed); box-shadow: 0 0 0 2px rgba(124,58,237,.25) inset; }
.cal .cnt { display: none; }
.cal-agenda { margin-top: 12px; display: grid; gap: 8px; }
.cal-agenda .ag-it { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--blue-bg); color: var(--blue-t); cursor: pointer; }
.cal-agenda .ag-it span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-agenda .ag-it b { font-family: var(--latin); white-space: nowrap; }
.cal-agenda .ag-it.od { background: var(--bad-bg); color: var(--bad-t); } .cal-agenda .ag-it.pd { background: var(--ok-bg); color: var(--ok-t); text-decoration: line-through; opacity: .8; }
@media (max-width: 760px) {
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cal .dname .full { display: none; } .cal .dname .short { display: inline; font-size: 11px; }
  .cal .day { min-height: 48px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-width: 0; }
  .cal .day .ev { display: none; }
  .cal .cnt { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font: 700 11px var(--latin); }
  .cal .cnt.od { background: var(--bad, #dc2626); }
  .card:has(> .cal) { padding: 10px; }
}
/* phone top bar: title on one line */
@media (max-width: 960px) {
  .top > div:has(> h1) { flex: 1 1 auto; min-width: 0; }
  .top h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
@media (max-width: 480px) {
  .top { gap: 4px; padding: 10px 10px; }
  .top .icon-btn { width: 34px; height: 34px; min-width: 34px; }
  .top .top-logo { width: 26px; height: 26px; }
  .top h1 { font-size: 15px; }
}
