/* ============================================================
 *  Org announcements — top-nav chip, detail modal, admin compose.
 * ============================================================ */

/* ---- Top-nav announcement chip (everyone) ---- */
.sys-anc-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 260px;
  border: 1px solid rgba(99, 102, 241, .28); background: rgba(99, 102, 241, .1);
  color: #4338ca; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
  animation: sysAncIn .25s ease;
}
.sys-anc-chip[hidden] { display: none; }
.sys-anc-chip:hover { background: rgba(99, 102, 241, .18); transform: translateY(-1px); }
.sys-anc-chip-icon { font-size: 14px; line-height: 1; }
.sys-anc-chip-text { overflow: hidden; text-overflow: ellipsis; }
.sys-anc-chip.warning { border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .12); color: #b45309; }
.sys-anc-chip.critical {
  border-color: rgba(220, 38, 38, .4); background: rgba(220, 38, 38, .12); color: #b91c1c;
  animation: sysAncIn .25s ease, sysAncPulse 2s ease-in-out infinite;
}
@keyframes sysAncIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes sysAncPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .35); } 50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); } }

@media (max-width: 720px) {
  .sys-anc-chip { max-width: 44px; }
  .sys-anc-chip-text { display: none; }
}

/* ---- Topnav "Announcements" button (everyone) ---- */
.sys-anc-btn {
  position: relative; border: none; background: rgba(99, 102, 241, .12); color: var(--nav-accent, #4f46e5);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
}
.sys-anc-btn:hover { background: rgba(99, 102, 241, .22); transform: translateY(-1px); }
.sys-anc-dot {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: #dc2626; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(220, 38, 38, .35);
}
.sys-anc-dot[hidden] { display: none; }

/* ---- Announcements center (right slide-over) ---- */
.sys-anc-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(15, 23, 42, .42); display: flex; justify-content: flex-end;
}
.sys-anc-overlay[hidden] { display: none; }
.sys-anc-drawer {
  width: 400px; max-width: 92vw; height: 100%; background: #fff; display: flex; flex-direction: column;
  box-shadow: -16px 0 50px rgba(2, 6, 23, .28); animation: sysAncSlide .22s ease;
}
@keyframes sysAncSlide { from { transform: translateX(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.sys-anc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #eef0f4;
}
.sys-anc-head h3 { margin: 0; font-size: 1.05rem; color: #0f172a; }
.sys-anc-x { border: none; background: none; font-size: 24px; line-height: 1; color: #94a3b8; cursor: pointer; }
.sys-anc-x:hover { color: #0f172a; }
.sys-anc-new {
  margin: 14px 18px 4px; padding: 10px 14px; border: 1px dashed #c7d2fe; background: #eef2ff;
  color: #4338ca; border-radius: 10px; font-size: .88rem; font-weight: 700; cursor: pointer;
}
.sys-anc-new:hover { background: #e0e7ff; }
.sys-anc-body { flex: 1; overflow-y: auto; padding: 10px 18px 24px; }
.sys-anc-loading { color: #94a3b8; font-size: .88rem; padding: 18px 2px; }
.sys-anc-sec { margin-top: 16px; }
.sys-anc-sec-h {
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #94a3b8; margin-bottom: 8px;
}
.sys-anc-empty { font-size: .85rem; color: #94a3b8; padding: 2px; }
.sys-anc-item {
  border: 1px solid #e7e9f0; border-left: 3px solid #6366f1; border-radius: 10px;
  padding: 11px 13px; margin-bottom: 9px; background: #fafbff;
}
.sys-anc-item.warning { border-left-color: #f59e0b; }
.sys-anc-item.critical { border-left-color: #dc2626; }
.sys-anc-item.past { opacity: .6; background: #f8fafc; }
.sys-anc-item-when { font-size: .82rem; font-weight: 700; color: #4338ca; margin-bottom: 3px; }
.sys-anc-item.warning .sys-anc-item-when { color: #b45309; }
.sys-anc-item.critical .sys-anc-item-when { color: #b91c1c; }
.sys-anc-item-msg { font-size: .9rem; color: #1f2937; line-height: 1.5; word-break: break-word; }
.sys-anc-item-by { font-size: .76rem; color: #94a3b8; margin-top: 4px; }

@media (max-width: 720px) { .sys-anc-drawer { width: 100vw; } }

/* ---- Announcement detail modal ---- */
.sys-bc-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.sys-bc-modal[hidden] { display: none; }
.sys-bc-card {
  background: #fff; border-radius: 16px; padding: 26px 28px; width: 92%; max-width: 420px;
  text-align: center; box-shadow: 0 24px 60px rgba(2, 6, 23, .32); border-top: 5px solid #6366f1;
}
.sys-bc-icon { font-size: 34px; line-height: 1; }
.sys-bc-label { margin-top: 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #6366f1; }
.sys-bc-text { margin: 10px 0 6px; font-size: 1.02rem; line-height: 1.55; color: #0f172a; font-weight: 600;
  white-space: pre-wrap; word-break: break-word; }
.sys-bc-when { font-size: .86rem; color: #475569; font-weight: 600; margin-bottom: 6px; }
.sys-bc-when:empty { display: none; }
.sys-bc-meta { font-size: .8rem; color: #94a3b8; margin-bottom: 16px; }
.sys-bc-meta:empty { margin-bottom: 6px; }
.sys-bc-ok { border: none; background: #4f46e5; color: #fff; border-radius: 10px;
  padding: 10px 26px; font-size: .9rem; font-weight: 700; cursor: pointer; }
.sys-bc-ok:hover { background: #4338ca; }
/* level accents */
.sys-bc-modal.warning .sys-bc-card { border-top-color: #f59e0b; }
.sys-bc-modal.warning .sys-bc-label { color: #b45309; }
.sys-bc-modal.warning .sys-bc-ok { background: #d97706; }
.sys-bc-modal.warning .sys-bc-ok:hover { background: #b45309; }
.sys-bc-modal.critical .sys-bc-card { border-top-color: #dc2626; }
.sys-bc-modal.critical .sys-bc-label { color: #b91c1c; }
.sys-bc-modal.critical .sys-bc-ok { background: #dc2626; }
.sys-bc-modal.critical .sys-bc-ok:hover { background: #b91c1c; }

/* ---- Admin compose modal ---- */
.sysalert-modal {
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center;
}
.sysalert-modal[hidden] { display: none; }
.sysalert-card {
  background: #fff; border-radius: 16px; width: 92%; max-width: 480px; padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .3); max-height: 88vh; overflow-y: auto;
}
.sysalert-head { display: flex; align-items: center; justify-content: space-between; }
.sysalert-head h3 { margin: 0; font-size: 1.1rem; color: #0f172a; }
.sysalert-x { border: none; background: none; font-size: 24px; line-height: 1; color: #94a3b8; cursor: pointer; }
.sysalert-x:hover { color: #0f172a; }
.sysalert-sub { margin: 4px 0 12px; font-size: .82rem; color: #64748b; }
.sysalert-card label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #94a3b8; margin: 10px 0 4px; }
.sysalert-card textarea, .sysalert-card select, .sysalert-card input {
  width: 100%; padding: 9px 11px; border: 1px solid #d7dbe4; border-radius: 9px;
  font-size: .9rem; font-family: inherit; color: #1f2937; box-sizing: border-box;
}
.sysalert-card textarea { resize: vertical; }
.sysalert-card textarea:focus, .sysalert-card select:focus, .sysalert-card input:focus {
  outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

/* type segmented control */
.sysalert-seg { display: flex; gap: 4px; background: #f1f3f9; border-radius: 11px; padding: 4px; margin-top: 6px; }
.sysalert-seg-btn { flex: 1; border: none; background: transparent; color: #64748b;
  font-size: .9rem; font-weight: 700; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.sysalert-seg-btn:hover { color: #1f2937; }
.sysalert-seg-btn.active { background: #fff; color: #4338ca; box-shadow: 0 1px 3px rgba(2, 6, 23, .12); }
.sysalert-modehint { margin: 8px 2px 0; font-size: .78rem; color: #94a3b8; }

/* scheduled date/time */
.sysalert-sched { margin-top: 12px; }
.sysalert-sched[hidden] { display: none; }
.sysalert-row { display: flex; gap: 10px; }
.sysalert-field { flex: 1; min-width: 0; }
.sysalert-field label { margin-top: 0; }
.sysalert-preview { margin-top: 10px; font-size: .82rem; font-weight: 600; color: #94a3b8;
  background: #f8fafc; border: 1px dashed #d7dbe4; border-radius: 9px; padding: 9px 11px; }
.sysalert-preview.ok { color: #4338ca; border-color: #c7d2fe; background: #eef2ff; border-style: solid; }
.sysalert-preview[hidden] { display: none; }

.sysalert-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sysalert-sendbtn { border: none; background: #4f46e5; color: #fff; border-radius: 9px;
  padding: 9px 16px; font-size: .86rem; font-weight: 600; cursor: pointer; }
.sysalert-sendbtn:hover:not(:disabled) { background: #4338ca; }
.sysalert-sendbtn:disabled { opacity: .6; cursor: default; }
.sysalert-cancelbtn { border: 1px solid #d7dbe4; background: #fff; color: #334155; border-radius: 9px;
  padding: 9px 14px; font-size: .86rem; font-weight: 600; cursor: pointer; }

/* manage list */
.sysalert-listhead { margin: 18px 0 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #94a3b8; border-top: 1px solid #eef0f4; padding-top: 14px; }
.sysalert-list { display: flex; flex-direction: column; gap: 8px; }
.sysalert-li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px;
  border: 1px solid #e7e9f0; border-left: 3px solid #6366f1; border-radius: 9px; background: #fafbff; }
.sysalert-li.warning { border-left-color: #f59e0b; }
.sysalert-li.critical { border-left-color: #dc2626; }
.sysalert-li-txt { flex: 1; min-width: 0; font-size: .86rem; color: #1f2937; line-height: 1.45;
  word-break: break-word; }
.sysalert-li-tag { display: block; font-size: .72rem; font-weight: 700; color: #6366f1; margin-bottom: 2px; }
.sysalert-li.warning .sysalert-li-tag { color: #b45309; }
.sysalert-li.critical .sysalert-li-tag { color: #b91c1c; }
.sysalert-li-del { border: none; background: none; color: #cbd5e1; font-size: 15px; cursor: pointer;
  line-height: 1; padding: 2px 4px; }
.sysalert-li-del:hover { color: #dc2626; }
.sysalert-li-empty { font-size: .84rem; color: #94a3b8; padding: 6px 2px; }
