/* ==========================================================================
   Multi Live Pro — shared components
   ========================================================================== */

/* Panels + cards */
.panel {
  background: linear-gradient(180deg, rgba(15, 27, 45, .9), rgba(8, 15, 27, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.panel-title .icon { width: 17px; height: 17px; color: var(--blue); }
.panel-subtitle { margin-top: 3px; color: var(--faint); font-size: 11px; font-weight: 400; }
.panel-body { padding: 19px; }
.panel-body.tight { padding: 13px; }
.panel-body.flush { padding: 0; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 19px; border-top: 1px solid var(--line); }
.panel-link { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 11.5px; font-weight: 600; }
.panel-link:hover { text-decoration: underline; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-hover { transition: border-color .18s, transform .18s, box-shadow .18s; }
.card-hover:hover { border-color: #2a4365; transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px 17px;
  background: linear-gradient(160deg, rgba(17, 31, 51, .95), rgba(9, 16, 28, .95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -35px;
  right: -35px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--accent, rgba(75, 141, 255, .18)), transparent 70%);
  pointer-events: none;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--accent-color, var(--blue));
  background: var(--accent-bg, var(--blue-soft));
  border-radius: 9px;
}
.stat-icon .icon { width: 16px; height: 16px; }
.stat-value { margin-top: 9px; font-size: 26px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.stat-value small { margin-left: 3px; color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--faint); font-size: 10.5px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend .icon { width: 12px; height: 12px; }

/* Badges + status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .015em;
  line-height: 1.45;
  white-space: nowrap;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 999px;
}
.badge .icon { width: 11px; height: 11px; }
.badge-blue { color: #a7c8ff; background: var(--blue-soft); border-color: rgba(75, 141, 255, .25); }
.badge-green { color: #8ff0be; background: var(--green-soft); border-color: rgba(50, 213, 131, .24); }
.badge-amber { color: #fddc94; background: var(--amber-soft); border-color: rgba(253, 176, 34, .24); }
.badge-red { color: #ffb3ad; background: var(--red-soft); border-color: rgba(249, 112, 102, .24); }
.badge-purple { color: #d0beff; background: var(--purple-soft); border-color: rgba(167, 139, 250, .24); }
.badge-fb { color: #b9d7ff; background: rgba(24, 119, 242, .14); border-color: rgba(24, 119, 242, .28); }
.badge-demo { color: #fddc94; background: rgba(253, 176, 34, .09); border-color: rgba(253, 176, 34, .2); }
.badge-live { color: #ffb4ae; background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .3); }
.badge-live::before { content: ''; width: 5px; height: 5px; background: #ff5a52; border-radius: 50%; animation: pulseDot 1.6s infinite; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status-live, .status-running, .status-published, .status-completed, .status-live-ready { color: var(--green); }
.status-live::before { background: #ff5a52; box-shadow: 0 0 0 3px rgba(255, 90, 82, .12); animation: pulseDot 1.8s infinite; }
.status-starting, .status-queued, .status-pending, .status-publishing, .status-scheduled { color: var(--blue); }
.status-simulated, .status-demo, .status-partial { color: var(--amber); }
.status-failed, .status-cancelled, .status-error { color: var(--red); }
.status-ended, .status-stopped, .status-offline { color: var(--faint); }
.status-stopping { color: var(--amber); }

/* Avatar */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  width: 38px;
  height: 38px;
  color: #dbe9ff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #21406b, #162742);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 10px; border-radius: 8px; }
.avatar-lg { width: 54px; height: 54px; font-size: 18px; border-radius: 14px; }
.avatar-fb { background: linear-gradient(135deg, #1877f2, #0b4ea8); }
.avatar-demo { background: linear-gradient(135deg, #7c5cff, #4527a0); }
.avatar-round { border-radius: 50%; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  padding: 10px 14px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .07em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid rgba(23, 39, 63, .65); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .022); }
.table .cell-main { color: var(--text); font-weight: 550; }
.table .cell-sub { margin-top: 2px; color: var(--faint); font-size: 10.5px; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }

/* Empty states */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 50px 24px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 3px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(75, 141, 255, .2);
  border-radius: 15px;
}
.empty-icon .icon { width: 23px; height: 23px; }
.empty h3 { font-size: 13.5px; font-weight: 650; }
.empty p { max-width: 380px; color: var(--faint); font-size: 11.5px; line-height: 1.6; }
.empty .btn { margin-top: 8px; }
.empty-sm { padding: 26px 16px; }
.empty-sm .empty-icon { width: 38px; height: 38px; border-radius: 11px; }
.empty-sm .empty-icon .icon { width: 18px; height: 18px; }

/* Progress */
.progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, .07);
  border-radius: 999px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--grad);
  border-radius: inherit;
  transition: width .35s var(--ease);
}
.progress.green > span { background: linear-gradient(90deg, #17a866, #32d583); }
.progress.amber > span { background: linear-gradient(90deg, #d98b0b, #fdb022); }
.progress.red > span { background: linear-gradient(90deg, #d4453c, #f97066); }
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line .progress { flex: 1; }
.progress-label { min-width: 38px; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; text-align: right; }

/* Menu / dropdown */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 190px;
  padding: 5px;
  background: #0c1626;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: var(--shadow);
  animation: menuIn .14s ease both;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu button, .menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  color: var(--text-2);
  font-size: 11.8px;
  font-weight: 500;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
}
.menu button:hover, .menu a:hover { color: var(--text); background: rgba(255, 255, 255, .055); }
.menu .icon { width: 15px; height: 15px; color: var(--muted); }
.menu button:hover .icon { color: var(--blue); }
.menu .danger { color: #ff9d96; }
.menu .danger .icon { color: #ff9d96; }
.menu-sep { height: 1px; margin: 5px 3px; background: var(--line); }
.menu-label { padding: 6px 9px 4px; color: var(--faint); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Modal */
.modal-root { position: relative; z-index: 100; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(2, 5, 10, .72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .16s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(540px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #0d1929, #08111e);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  animation: modalIn .22s var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal.modal-md { width: min(680px, 100%); }
.modal.modal-lg { width: min(880px, 100%); }
.modal.modal-xl { width: min(1080px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -.02em; }
.modal-head p { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.modal-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); border-color: var(--line); }
.modal-body { padding: 20px 21px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 21px;
  background: rgba(4, 8, 15, .35);
  border-top: 1px solid var(--line);
}
.modal-foot .left { margin-right: auto; }

/* Toasts */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(370px, calc(100vw - 40px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
  background: #0d1929;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toastIn .25s var(--ease) both;
}
.toast.out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(14px); } }
.toast-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: none; border-radius: 7px; }
.toast-icon .icon { width: 15px; height: 15px; }
.toast-success .toast-icon { color: var(--green); background: var(--green-soft); }
.toast-error .toast-icon { color: var(--red); background: var(--red-soft); }
.toast-info .toast-icon { color: var(--blue); background: var(--blue-soft); }
.toast-warn .toast-icon { color: var(--amber); background: var(--amber-soft); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { color: var(--text); font-weight: 600; font-size: 12px; }
.toast-msg { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.toast-x { background: 0; border: 0; color: var(--faint); padding: 2px; }

/* Callout */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.6;
  background: rgba(75, 141, 255, .06);
  border: 1px solid rgba(75, 141, 255, .17);
  border-radius: 10px;
}
.callout .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--blue); }
.callout strong { color: var(--text); font-weight: 600; }
.callout-warn { background: rgba(253, 176, 34, .06); border-color: rgba(253, 176, 34, .2); }
.callout-warn .icon { color: var(--amber); }
.callout-danger { background: rgba(249, 112, 102, .06); border-color: rgba(249, 112, 102, .2); }
.callout-danger .icon { color: var(--red); }
.callout-success { background: rgba(50, 213, 131, .06); border-color: rgba(50, 213, 131, .2); }
.callout-success .icon { color: var(--green); }

/* Upload dropzone */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .012) 0 10px, transparent 10px 20px),
    rgba(5, 11, 20, .5);
  border: 1.5px dashed #284260;
  border-radius: var(--radius);
  cursor: pointer;
  transition: .18s;
}
.dropzone:hover, .dropzone.dragover { border-color: rgba(75, 141, 255, .7); background-color: rgba(75, 141, 255, .05); }
.dropzone-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.dropzone-icon .icon { width: 20px; height: 20px; }
.dropzone strong { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.dropzone span { color: var(--faint); font-size: 10.5px; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.upload-bar { display: flex; flex-direction: column; gap: 6px; }
.upload-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }

/* Media thumbnail mini */
.thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #07101d;
  border-radius: 9px;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--faint); }
.thumb .duration {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
  color: #fff;
  font-size: 9px;
  font-weight: 650;
  background: rgba(0, 0, 0, .72);
  border-radius: 4px;
}

/* Page picker */
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.picker-head .field-label { font-size: 11px; }
.picker-actions { display: flex; gap: 8px; }
.picker-actions button { padding: 0; color: var(--blue); font-size: 10.5px; font-weight: 600; background: none; border: 0; }
.picker-actions button:hover { text-decoration: underline; }
.picker-list {
  max-height: 246px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(4, 9, 17, .45);
  border: 1px solid var(--line);
  border-radius: 9px;
  scrollbar-width: thin;
  scrollbar-color: #2a4365 transparent;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .13s;
}
.picker-row:hover { background: rgba(255, 255, 255, .04); }
.picker-row.selected { background: rgba(75, 141, 255, .08); }
.picker-row input { width: 14px; height: 14px; flex: none; accent-color: var(--blue); }
.picker-row .avatar { width: 26px; height: 26px; font-size: 9px; border-radius: 7px; }
.picker-info { flex: 1; min-width: 0; }
.picker-name { overflow: hidden; color: var(--text-2); font-size: 11.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.picker-meta { color: var(--faint); font-size: 9.5px; }
.picker-row .badge { font-size: 8.5px; padding: 2px 5px; }
.picker-group-label {
  padding: 8px 8px 4px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.picker-empty { padding: 18px 12px; color: var(--faint); font-size: 11px; text-align: center; }

/* Log console */
.console {
  overflow: hidden;
  background: #050b14;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .025);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.console-live { display: inline-flex; align-items: center; gap: 5px; color: var(--green); }
.console-live::before { content: ''; width: 5px; height: 5px; background: var(--green); border-radius: 50%; }
.console-body {
  height: 210px;
  overflow-y: auto;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.75;
  scrollbar-width: thin;
  scrollbar-color: #243b5b transparent;
}
.log-line { display: flex; gap: 9px; color: #9fb2c9; }
.log-time { flex: none; color: #4f6684; }
.log-line.warn { color: #fddc94; }
.log-line.error { color: #ffa39c; }
.log-line.success { color: #8ff0be; }
.log-line.info { color: #9fb2c9; }
.console-empty { display: grid; place-items: center; height: 100%; color: var(--faint); font-family: var(--font); font-size: 11px; }

/* Live status targets */
.target-list { display: flex; flex-direction: column; gap: 7px; }
.target {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, .022);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.target .avatar { width: 30px; height: 30px; font-size: 9.5px; border-radius: 8px; }
.target-info { flex: 1; min-width: 0; }
.target-name { color: var(--text-2); font-size: 11.8px; font-weight: 550; }
.target-meta { display: flex; align-items: center; gap: 5px; margin-top: 1px; color: var(--faint); font-size: 9.5px; }
.target .status { font-size: 10px; }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid rgba(23, 39, 63, .6); }
.feed-item:last-child { border-bottom: 0; }
.feed-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border-radius: 8px;
}
.feed-icon .icon { width: 14px; height: 14px; }
.feed-icon.blue { color: var(--blue); background: var(--blue-soft); }
.feed-icon.green { color: var(--green); background: var(--green-soft); }
.feed-icon.amber { color: var(--amber); background: var(--amber-soft); }
.feed-icon.red { color: var(--red); background: var(--red-soft); }
.feed-icon.purple { color: var(--purple); background: var(--purple-soft); }
.feed-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feed-text { color: var(--text-2); font-size: 11.5px; line-height: 1.5; }
.feed-time { margin-top: 0; color: var(--faint); font-size: 10px; }

/* Switch rows in settings */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(23, 39, 63, .6);
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row:first-child { padding-top: 0; }
.setting-copy strong { display: block; color: var(--text-2); font-size: 12px; font-weight: 600; }
.setting-copy span { display: block; margin-top: 2px; color: var(--faint); font-size: 10.5px; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .085), rgba(255, 255, 255, .04));
  background-size: 200% 100%;
  border-radius: 7px;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 1; min-width: 0; height: 100%; justify-content: flex-end; }
.bar-stack { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; flex: 1; }
.bar {
  width: 9px;
  min-height: 3px;
  background: linear-gradient(180deg, #6ba1ff, #2e63d4);
  border-radius: 4px 4px 2px 2px;
  transition: height .4s var(--ease);
}
.bar.alt { background: linear-gradient(180deg, #b39bff, #6d4fd4); }
.bar.ghost { background: rgba(255, 255, 255, .07); }
.bar-label { color: var(--faint); font-size: 9px; }
.legend { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.legend i.alt { background: var(--purple); }

/* Toast icon color helpers */
.text-center { text-align: center; }
