/* GoHome Admin P0 — shared layout tokens, dashboard todos, page chrome */

:root {
  --p0-ink: #0f172a;
  --p0-muted: #64748b;
  --p0-line: #e2e8f0;
  --p0-blue: #2563eb;
  --p0-blue-soft: #eff6ff;
  --p0-danger: #be123c;
  --p0-danger-soft: #fff1f2;
  --p0-warn: #b45309;
  --p0-warn-soft: #fff7ed;
  --p0-good: #15803d;
  --p0-good-soft: #ecfdf5;
  --p0-radius: 20px;
  --p0-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

/* —— Page hero (replaces per-module gradient heroes over time) —— */
.p0PageHero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--p0-line);
  border-left: 4px solid var(--p0-blue);
  border-radius: var(--p0-radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--p0-shadow);
}

body.adminPlatform .p0PageHero {
  border-left: none;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(31, 35, 41, 0.04);
}

.p0PageHeroTitle {
  font-size: 22px;
  font-weight: 950;
  color: var(--p0-ink);
  letter-spacing: -0.3px;
}

.p0PageHeroText {
  margin-top: 6px;
  color: var(--p0-muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
}

/* —— Unified toolbar —— */
.p0Toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--p0-line);
  border-radius: 16px;
}

.p0Toolbar .input,
.p0Toolbar .select {
  min-width: 0;
}

.p0ToolbarSpacer {
  flex: 1;
  min-width: 8px;
}

/* —— Dashboard: todo cards —— */
.p0TodoSection {
  margin-bottom: 18px;
}

.p0SectionTitle {
  font-size: 15px;
  font-weight: 950;
  color: var(--p0-ink);
  margin: 0 0 10px 2px;
}

.p0TodoGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.p0TodoCard {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--p0-line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--p0-shadow);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.p0TodoCard:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.1);
}

.p0TodoCard--urgent {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff, var(--p0-danger-soft));
}

.p0TodoCard--warn {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff, var(--p0-warn-soft));
}

.p0TodoCard--ok {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #fff, var(--p0-good-soft));
}

.p0TodoCard--neutral {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #fff, var(--p0-blue-soft));
}

.p0TodoLabel {
  font-size: 12px;
  font-weight: 900;
  color: var(--p0-muted);
  text-transform: none;
}

.p0TodoValue {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 950;
  color: var(--p0-ink);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.p0TodoHint {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 750;
  color: #94a3b8;
  line-height: 1.45;
}

.p0TodoBadge {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  background: #f1f5f9;
  color: #475569;
}

.p0TodoCard--urgent .p0TodoBadge {
  background: #ffe4e6;
  color: var(--p0-danger);
}

.p0TodoCard--warn .p0TodoBadge {
  background: #fef3c7;
  color: var(--p0-warn);
}

/* —— Dashboard: compact stats —— */
.p0StatGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.p0Stat {
  background: #fff;
  border: 1px solid var(--p0-line);
  border-radius: 16px;
  padding: 14px 16px;
}

.p0StatK {
  font-size: 12px;
  font-weight: 900;
  color: var(--p0-muted);
}

.p0StatV {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 950;
  color: var(--p0-ink);
}

.p0StatS {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 750;
  color: #94a3b8;
}

/* —— Quick actions row —— */
.p0QuickRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* —— Nav P0 (extends gh1115) —— */
.p0NavVersion {
  display: inline-flex;
  margin-top: 8px;
  align-items: center;
  gap: 6px;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 1000;
}

.p0NavGroup {
  margin-top: 12px;
}

.p0NavHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 5px;
  color: #334155;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.p0NavNote {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 850;
  margin-top: 2px;
  letter-spacing: 0;
}

.p0NavCount {
  background: #f1f5f9;
  color: #64748b;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 1000;
}

.p0NavBtn {
  width: 100%;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  padding: 9px 10px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
}

.p0NavBtn .p0NavIcon {
  font-size: 16px;
  text-align: center;
}

.p0NavBtn.active,
.nav .p0NavBtn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28) !important;
}

.p0NavBtnTitle {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 900;
}

.p0NavSearch {
  margin-top: 12px;
}

.p0NavSearch input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.p0NavSearch input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.p0AlertBanner {
  background: var(--p0-warn-soft);
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.p0AlertBanner--danger {
  background: var(--p0-danger-soft);
  border-color: #fecaca;
  color: #9f1239;
}

@media (max-width: 1100px) {
  .p0TodoGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p0StatGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .p0TodoGrid,
  .p0StatGrid {
    grid-template-columns: 1fr;
  }
  .p0PageHero {
    flex-direction: column;
  }
}

/* —— P1: reports queue + drawer —— */
.p1QueueTabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.p1QueueTabs button {
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  background: #fff;
  border: 1px solid var(--p0-line);
  color: #475569;
  cursor: pointer;
}

.p1QueueTabs button.active {
  background: var(--p0-blue);
  border-color: var(--p0-blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

body.adminPlatform .p1DrawerSection {
  border-bottom-color: #eceef2;
}

body.adminPlatform .p1DrawerCard {
  background: #fafbfc;
  border-color: #eceef2;
  border-radius: 12px;
}

body.adminPlatform .p1DrawerActions .btn {
  min-height: 36px;
}

.p1ReportsPanel {
  padding: 0;
  overflow: hidden;
}

.p1ReportsTable {
  min-width: 880px;
}

.p1ReportRow {
  cursor: pointer;
  transition: background 0.12s ease;
}

.p1ReportRow:hover td {
  background: #f8fbff;
}

.p1ReportRow--open td {
  background: #fffbeb;
}

.p1DrawerSection {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.p1DrawerSection:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.p1DrawerMeta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.p1DrawerCard {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.p1DrawerEmpty {
  margin-top: 10px;
  color: #94a3b8;
  font-weight: 800;
  padding: 16px;
}

.p1DmThreadPreview {
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
}

.p1DmMsg {
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.p1DmMsg:last-child {
  border-bottom: 0;
}

.p1DmMsg--highlight {
  background: #fff7ed;
  border-radius: 10px;
  padding: 8px;
  margin: 4px 0;
}

.p1ProfileMediaRow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.p1ProfileMedia {
  flex: 1;
  min-width: 120px;
}

.p1ProfileAvatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  margin-top: 6px;
}

.p1ProfileCover {
  width: 100%;
  max-width: 220px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  margin-top: 6px;
}

.p1DmMedia {
  margin-top: 6px;
}

.p1DmMediaImg {
  max-width: 100%;
  max-height: 160px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: block;
}

.p1DmMediaAudio {
  width: 100%;
  max-width: 280px;
  margin-top: 4px;
}

.p1TemplateRow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.p1DrawerActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.p1DrawerWarn {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 800;
  font-size: 13px;
}

.p1AiRoleBar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
