/* Roles of the accounts and the requests for the warehouse: the window of the roles, the request cards, the red panel of the storekeeper. */

/* ---- Dialog "Аккаунты": the accounts and, next to them, the small window of the roles ---- */

.accounts-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.accounts-col { display: grid; gap: 12px; min-width: 0; }
.roles { display: grid; gap: 10px; padding: 14px; background: var(--raised); border-radius: var(--r-lg); min-width: 0; }
.roles-title { font-size: var(--fs-caption); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.role { display: grid; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.role-name { font-size: 14px; font-weight: 600; }
.role-about { font-size: var(--fs-caption); line-height: 1.45; color: var(--text-2); }
.role-who { display: grid; gap: 2px; margin-top: 4px; }
.role-row { min-height: 32px; min-width: 0; }
.tag-store { background: color-mix(in srgb, var(--primary) 18%, var(--bg)); color: var(--text); }
@media (max-width: 760px) { .accounts-split { grid-template-columns: 1fr; } }

/* ---- A request for the warehouse: the brand and the article, what it is, the comment ---- */

.req-body { display: grid; gap: 4px; min-width: 0; }
.req-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.req-brand { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.req-article { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.req-comment { font-size: var(--fs-caption); color: var(--text-3); white-space: pre-wrap; overflow-wrap: anywhere; }

.memos.requests { columns: 300px; }
.memos > .empty { column-span: all; }
/* In a narrow card the line of the state stands alone and the buttons under it, at the right edge (nothing sticks out of the card) */
.memo.req .memo-foot { flex-wrap: wrap; row-gap: 8px; }
.memo.req .memo-meta { flex: 1 1 100%; white-space: normal; }
.memo.req .req-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.memo.req .btn-secondary { background: var(--surface); }
.memo.req .btn-secondary:hover:not(:disabled) { background: var(--selected); }
.memo.req.is-sent { background: color-mix(in srgb, var(--primary) 7%, var(--raised)); }
.memo.req.is-late {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 12%, var(--surface)) 0 10px, color-mix(in srgb, var(--danger) 22%, var(--surface)) 10px 20px);
}

/* The tab "Склад" of a storekeeper burns red while there is something in it, and so does the badge on the notes */
.seg button.is-alert { color: var(--danger); animation: alert-glow 1.8s ease-in-out infinite; }
.seg button.is-alert[aria-pressed="true"] { background: var(--danger-soft); color: var(--danger); }
.badge.badge-alert { background: var(--danger); color: #fff; animation: alert-glow 1.8s ease-in-out infinite; }

/* ---- The red panel of the storekeeper: over everything, bottom right; after 10 minutes it comes to the middle, bigger ---- */

.alert-host { position: fixed; inset: 0; z-index: 135; pointer-events: none; }
.alert-scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--danger) 10%, var(--overlay)); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s var(--ease); }
.alert-center { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.alert-stack { position: fixed; right: 18px; bottom: 18px; width: min(340px, calc(100vw - 36px)); }
@media (max-width: 899px) { .alert-stack { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); } }

.alert-card {
  --stripe-a: color-mix(in srgb, var(--danger) 14%, var(--surface));
  --stripe-b: color-mix(in srgb, var(--danger) 26%, var(--surface));
  display: grid; gap: 10px; padding: 14px 16px; pointer-events: auto;
  background: repeating-linear-gradient(135deg, var(--stripe-a) 0 10px, var(--stripe-b) 10px 20px);
  border: 1px solid color-mix(in srgb, var(--danger) 60%, transparent); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  animation: alert-in .26s var(--ease), alert-breathe 1.8s ease-in-out .3s infinite; /* it grows and shrinks, so it is not missed */
}
.alert-head { display: flex; align-items: center; gap: 8px; }
.alert-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--danger); color: #fff; flex: none; }
.alert-icon svg { width: 14px; height: 14px; }
.alert-title { font-weight: 650; }
.alert-wait { margin-left: auto; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.alert-ask { font-size: var(--fs-caption); line-height: 1.45; color: var(--text); }
.alert-more { font-size: var(--fs-caption); font-weight: 600; color: var(--danger); }
.alert-foot { display: flex; justify-content: flex-end; gap: 8px; }
.alert-foot .btn-secondary { background: color-mix(in srgb, var(--surface) 80%, transparent); }
.alert-hint { font-size: 11px; color: var(--text-2); text-align: right; }
.alert-foot .btn svg { width: 14px; height: 14px; margin-left: 2px; }

.alert-card.is-late {
  width: min(560px, 100%); gap: 16px; padding: 26px 28px; border-radius: var(--r-xl);
  animation: alert-in .3s var(--ease), alert-breathe-big 1.5s ease-in-out .3s infinite;
}
.alert-card.is-late .alert-icon { width: 40px; height: 40px; }
.alert-card.is-late .alert-icon svg { width: 21px; height: 21px; }
.alert-card.is-late .alert-title { font-size: 22px; }
.alert-card.is-late .alert-wait { background: var(--danger); color: #fff; font-size: 15px; padding: 4px 12px; }
.alert-card.is-late .alert-ask { font-size: 15px; }
.alert-card.is-late .alert-more { font-size: 13px; }
.alert-card.is-late .alert-hint { font-size: 12px; }
.alert-card.is-late .btn { height: 46px; padding: 0 26px; font-size: 15px; }

@keyframes alert-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes alert-breathe {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow), 0 0 0 0 transparent; }
  50% { transform: scale(1.04); box-shadow: var(--shadow), 0 0 0 9px color-mix(in srgb, var(--danger) 28%, transparent); }
}
@keyframes alert-breathe-big {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow), 0 0 0 0 transparent; }
  50% { transform: scale(1.025); box-shadow: var(--shadow), 0 0 0 20px color-mix(in srgb, var(--danger) 26%, transparent); }
}
@keyframes alert-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  .alert-card, .alert-card.is-late, .seg button.is-alert, .badge.badge-alert { animation: none; }
}