/* StreamPix CEO / DONO Administrative Mode */
.header-action.sp-ceo-header-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none !important;
  gap: 7px !important;
  width: auto !important;
  min-width: max-content !important;
  height: 36px !important;
  padding: 0 13px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(234, 88, 12, 0.22)) !important;
  border: 1px solid rgba(245, 158, 11, 0.55) !important;
  color: #fde68a !important;
  font: 700 12px/1 Inter, "Helvetica Neue", Arial, sans-serif !important;
  cursor: pointer;
}

.header-action.sp-ceo-header-btn[hidden],
.sp-admin-shell[hidden] {
  display: none !important;
}

.header-action.sp-ceo-header-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.36), rgba(234, 88, 12, 0.34)) !important;
  color: #ffffff !important;
}

.sp-ceo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #0b111b;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 6px;
}

.sp-admin-shell {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background: #070d18;
  color: #f1f5f9;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

.sp-admin-shell[hidden] {
  display: none !important;
}

.sp-admin-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 16px;
  background: linear-gradient(180deg, #0d172a 0%, #091120 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-admin-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sp-admin-brand strong {
  display: block;
  font-size: 15px;
  color: #ffffff;
}

.sp-admin-brand span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.sp-admin-nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.sp-admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font: 600 13.5px/1 Inter, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: all 140ms ease;
}

.sp-admin-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sp-admin-nav-btn.is-active {
  background: linear-gradient(135deg, rgba(22, 200, 223, 0.16), rgba(16, 217, 152, 0.14));
  border-color: rgba(22, 200, 223, 0.35);
  color: #67e8f9;
}

.sp-admin-nav-btn.is-ai.is-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.16));
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.sp-admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.sp-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 18, 32, 0.88);
}

.sp-admin-topbar h2 {
  margin: 0;
  font-size: 20px;
}

.sp-admin-topbar p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.sp-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.sp-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.sp-admin-card {
  padding: 18px;
  border-radius: 14px;
  background: #0e182b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-admin-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}

.sp-admin-kpi {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
}

.sp-admin-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0e182b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.sp-admin-toggle-row strong {
  display: block;
  font-size: 14px;
}

.sp-admin-toggle-row span {
  display: block;
  font-size: 12px;
  color: #94a3b8;
}

.sp-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sp-admin-table th,
.sp-admin-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sp-admin-table th {
  color: #94a3b8;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Executive AI Chat */
.sp-ceo-chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  border-radius: 16px;
  background: #0b1324;
  border: 1px solid rgba(245, 158, 11, 0.25);
  overflow: hidden;
}

.sp-ceo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-ceo-msg {
  max-width: 82%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sp-ceo-msg.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #10b981, #0284c7);
  color: #ffffff;
}

.sp-ceo-msg.is-ai {
  align-self: flex-start;
  background: #132038;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.sp-ceo-chat-form {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #09101f;
}

.sp-ceo-chat-form input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #111c33;
  color: #ffffff;
  font: inherit;
  font-size: 13.5px;
}

/* Admin Users, Balance Editor, Notifications & Live App Bell Badge */
.sp-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sp-admin-search {
  height: 36px;
  min-width: 230px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a1222;
  color: #f8fafc;
  font: inherit;
  font-size: 12.5px;
  outline: none;
}

.sp-admin-search:focus {
  border-color: #22d3ee;
}

.sp-admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.sp-admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.sp-admin-pill.is-ceo {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

.sp-admin-pill.is-admin {
  background: rgba(34, 211, 238, 0.18);
  color: #67e8f9;
}

.sp-admin-pill.is-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.sp-admin-pill.is-warn {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.sp-admin-pill.is-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.sp-admin-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sp-admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10025;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 16, 0.78);
  backdrop-filter: blur(10px);
  overflow-y: auto;
}

.sp-admin-modal-card {
  width: 100%;
  max-width: 600px;
  padding: 22px 24px;
  border-radius: 18px;
  background: #0d1628;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  display: grid;
  gap: 14px;
}

.sp-admin-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.sp-admin-form-grid *,
.sp-admin-card * {
  box-sizing: border-box;
}

.sp-col-2 {
  grid-column: 1 / -1;
  min-width: 0;
}

.sp-admin-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.sp-admin-field span {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.sp-admin-input,
.sp-admin-select,
.sp-admin-textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #08101e;
  color: #f8fafc;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sp-admin-input:focus,
.sp-admin-select:focus,
.sp-admin-textarea:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.sp-admin-textarea {
  resize: vertical;
  min-height: 84px;
}

.sp-admin-card .sp-secondary-btn {
  width: auto !important;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Topbar Bell Unread Badge & Rich Notification Items */
#notifications-toggle {
  position: relative;
}

.sp-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #0b111b;
}

.sp-notif-badge[hidden] {
  display: none !important;
}

.sp-notif-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sp-notif-mark-all {
  border: 0;
  background: transparent;
  color: #22d3ee;
  font: 700 11.5px/1 Inter, sans-serif;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.sp-notif-mark-all:hover {
  background: rgba(34, 211, 238, 0.12);
}

.notification-card.is-unread {
  border-left: 3px solid #22d3ee;
  background: rgba(34, 211, 238, 0.08);
}

.notification-copy-rich {
  display: grid;
  gap: 2px;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.notification-copy-rich strong {
  font-size: 12.5px;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-copy-rich small {
  font-size: 11.5px;
  opacity: 0.78;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-copy-rich time {
  font-size: 10.5px;
  opacity: 0.58;
  margin-top: 2px;
}

.sp-notif-detail-body {
  display: grid;
  gap: 10px;
  text-align: left;
  padding: 8px 4px;
}

.sp-notif-detail-body h3 {
  margin: 0;
  font-size: 18px;
}

.sp-notif-detail-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .sp-admin-shell {
    grid-template-columns: 1fr;
  }
  .sp-admin-sidebar {
    display: none;
  }
  .sp-admin-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Card independente de confirmação de reprogramação CEO ("Manter modificação?" — 5s auto-desfazer) */
.sp-ceo-mod-toast {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10060;
  width: min(336px, calc(100vw - 28px));
  padding: 15px 16px 14px;
  border-radius: 18px;
  background: rgba(9, 13, 24, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.44);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.62), 0 0 26px rgba(245, 158, 11, 0.16);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: #f8fafc;
  font-family: var(--sp-font, "Inter", system-ui, sans-serif);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 240ms cubic-bezier(.16, 1, .3, 1), transform 280ms cubic-bezier(.16, 1, .3, 1);
}

.sp-ceo-mod-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sp-ceo-mod-toast-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sp-ceo-mod-toast-head strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.015em;
}

.sp-ceo-mod-toast-head span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #fbbf24;
  font-weight: 600;
}

.sp-ceo-mod-timer {
  flex: none;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sp-ceo-mod-toast-desc {
  margin: 8px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.78);
}

.sp-ceo-mod-progress {
  height: 3px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 12px;
}

.sp-ceo-mod-progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f59e0b, #38bdf8);
  transform-origin: left center;
  animation: spCeoModShrink 5s linear forwards;
}

@keyframes spCeoModShrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.sp-ceo-mod-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sp-ceo-mod-btn {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 140ms ease, background 160ms ease, border-color 160ms ease;
}

.sp-ceo-mod-btn:hover {
  transform: translateY(-1px);
}

.sp-ceo-mod-btn.is-apply {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-color: transparent;
  color: #031318;
}

.sp-ceo-mod-btn.is-undo {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.sp-ceo-mod-btn.is-undo:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #ffffff;
}
