/* ==========================================================================
   AUDIKUNG COCKPIT — 3-TAB SYSTEM & REVENUE ORBIT
   Assets: assets/today-cockpit.css
   ========================================================================== */

/* ── 1. Top Cockpit Tab Switcher ── */
.cockpit-switcher-wrap {
  margin: 0.75rem 0 1.5rem;
  position: sticky;
  top: 68px;
  z-index: 95;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.cockpit-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.4rem;
  background: rgba(8, 14, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cockpit-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted, #a8b0c1);
  cursor: pointer;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cockpit-tab-btn:hover {
  color: var(--text, #f4f5f7);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.cockpit-tab-btn.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(226, 189, 102, 0.16) 0%, rgba(121, 183, 242, 0.1) 100%);
  border-color: rgba(226, 189, 102, 0.38);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 16px rgba(226, 189, 102, 0.15);
}

.cockpit-tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold, #e2bd66), transparent);
  box-shadow: 0 0 8px var(--gold, #e2bd66);
}

.cockpit-tab-num {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted, #a8b0c1);
}

.cockpit-tab-btn.is-active .cockpit-tab-num {
  background: var(--gold, #e2bd66);
  color: #050914;
}

.cockpit-tab-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cockpit-tab-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cockpit-tab-title {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cockpit-tab-desc {
  font-size: 0.72rem;
  color: var(--muted, #a8b0c1);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cockpit-tab-btn.is-active .cockpit-tab-desc {
  color: rgba(255, 255, 255, 0.75);
}

/* ── 2. Panels Visibility & Transitions ── */
.cockpit-panel {
  display: block;
  opacity: 1;
  animation: cockpit-fade 0.25s ease-out;
}

.cockpit-panel[hidden] {
  display: none !important;
}

@keyframes cockpit-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 3. Revenue Tab — Stage & Opening ── */
.revenue-opening {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.revenue-opening .opening-copy h2 {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin: 0.25rem 0 0.5rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.revenue-lede {
  color: var(--muted, #a8b0c1);
  font-size: 0.94rem;
  margin: 0;
  max-width: 60ch;
}

.revenue-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(226, 189, 102, 0.4);
  background: linear-gradient(135deg, rgba(226, 189, 102, 0.18), rgba(226, 189, 102, 0.05));
  color: var(--gold, #e2bd66);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-pill-btn:hover {
  background: var(--gold, #e2bd66);
  color: #050914;
  box-shadow: 0 0 16px rgba(226, 189, 102, 0.4);
  transform: translateY(-1px);
}

.action-pill-btn.is-ghost {
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted, #a8b0c1);
}

.action-pill-btn.is-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

/* ── 4. The Cosmic Orbit Stage (Desktop View) ── */
.revenue-orbit-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 580px;
  border-radius: 28px;
  padding: 2.5rem 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(121, 183, 242, 0.22);
  background:
    radial-gradient(ellipse 65% 55% at 50% 50%, rgba(20, 36, 70, 0.65), transparent 75%),
    radial-gradient(circle at 18% 22%, rgba(226, 189, 102, 0.1), transparent 35%),
    radial-gradient(circle at 82% 78%, rgba(176, 151, 237, 0.1), transparent 35%),
    linear-gradient(180deg, #030713 0%, #060c1c 50%, #030713 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Cosmic stars backdrop */
.revenue-orbit-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #ffffff, transparent),
    radial-gradient(1px 1px at 28% 45%, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 42% 14%, #ffffff, transparent),
    radial-gradient(1.2px 1.2px at 68% 25%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 85% 15%, #ffffff, transparent),
    radial-gradient(1px 1px at 88% 62%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.8px 1.8px at 22% 78%, #ffffff, transparent),
    radial-gradient(1px 1px at 58% 85%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 78% 82%, #ffffff, transparent);
}

/* Orbital Rings (Concentric Circles) */
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 2;
}

.orbit-ring.ring-inner {
  width: min(520px, 80%);
  height: min(440px, 70%);
}

.orbit-ring.ring-outer {
  width: min(760px, 94%);
  height: min(520px, 88%);
  border-color: rgba(226, 189, 102, 0.12);
}

/* Center Sun — Audi's Core Portrait */
.orbit-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sun-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--gold, #e2bd66), #b097ed, var(--blue, #79b7f2));
  box-shadow: 0 0 40px rgba(226, 189, 102, 0.35), 0 0 80px rgba(121, 183, 242, 0.2);
  animation: sun-pulse 5s ease-in-out infinite alternate;
}

@keyframes sun-pulse {
  0% {
    box-shadow: 0 0 30px rgba(226, 189, 102, 0.3), 0 0 60px rgba(121, 183, 242, 0.15);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 50px rgba(226, 189, 102, 0.45), 0 0 90px rgba(176, 151, 237, 0.25);
    transform: scale(1.02);
  }
}

.sun-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #030713;
}

.sun-label-chip {
  margin-top: 0.75rem;
  background: rgba(8, 14, 28, 0.9);
  border: 1px solid rgba(226, 189, 102, 0.4);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(8px);
}

.sun-label-chip strong {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.sun-label-chip small {
  font-size: 0.68rem;
  color: var(--gold, #e2bd66);
  font-weight: 700;
  text-transform: uppercase;
}

/* Satellites Container */
.orbit-satellites {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Satellite Node (Floating Cards) */
.orbit-node {
  position: absolute;
  z-index: 6;
  width: 220px;
  background: rgba(10, 16, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 0.85rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  animation: node-float 6s ease-in-out infinite alternate;
}

.orbit-node:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: rgba(226, 189, 102, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(226, 189, 102, 0.25);
  z-index: 12;
}

@keyframes node-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-7px); }
}

/* Stagger float animation for realism */
.orbit-node:nth-child(2) { animation-delay: -1.5s; }
.orbit-node:nth-child(3) { animation-delay: -3s; }
.orbit-node:nth-child(4) { animation-delay: -4.5s; }
.orbit-node:nth-child(5) { animation-delay: -2s; }

/* Desktop Coordinate Slots */
.orbit-node.slot-1 { top: 7%; left: 16%; }
.orbit-node.slot-2 { top: 7%; right: 16%; }
.orbit-node.slot-3 { bottom: 8%; left: 14%; }
.orbit-node.slot-4 { bottom: 8%; right: 14%; }
.orbit-node.slot-5 { top: 46%; right: 4%; }
.orbit-node.slot-6 { top: 46%; left: 4%; }

/* Node Header: Avatar + Tier + Action Tools */
.node-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
}

.node-icon-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}

.node-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.node-tier-pill {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Tier Color Coding */
.tier-core {
  background: rgba(226, 189, 102, 0.18);
  color: var(--gold, #e2bd66);
  border: 1px solid rgba(226, 189, 102, 0.35);
}
.tier-growth {
  background: rgba(91, 203, 208, 0.18);
  color: var(--cyan, #5bcbd0);
  border: 1px solid rgba(91, 203, 208, 0.35);
}
.tier-recurring {
  background: rgba(176, 151, 237, 0.18);
  color: var(--violet, #b097ed);
  border: 1px solid rgba(176, 151, 237, 0.35);
}
.tier-alpha {
  background: rgba(244, 154, 85, 0.18);
  color: var(--orange, #f49a55);
  border: 1px solid rgba(244, 154, 85, 0.35);
}
.tier-support {
  background: rgba(121, 183, 242, 0.18);
  color: var(--blue, #79b7f2);
  border: 1px solid rgba(121, 183, 242, 0.35);
}

/* Edit & Delete Mini Buttons */
.node-tools {
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.orbit-node:hover .node-tools {
  opacity: 1;
}

.btn-tool-mini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.btn-tool-mini:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #fff;
  transform: scale(1.1);
}

.btn-tool-mini.btn-delete:hover {
  background: #f1847d;
  color: #111;
  border-color: #f1847d;
}

/* Node Body */
.node-body {
  margin-top: 0.65rem;
}

.node-title {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.25;
}

.node-desc {
  font-size: 0.72rem;
  color: var(--muted, #a8b0c1);
  margin: 0.25rem 0 0.45rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-target {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold, #e2bd66);
  background: rgba(226, 189, 102, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  display: inline-block;
  margin-top: 0.2rem;
}

.node-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue, #79b7f2);
  text-decoration: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 0.45rem;
  width: 100%;
}

.node-action-link:hover {
  color: var(--gold, #e2bd66);
  text-decoration: underline;
}

/* ── 5. Financial Health Bridge (Cards Below Orbit) ── */
.revenue-money-bridge {
  margin-top: 2rem;
  padding: 1.8rem 2rem;
  border: 1px solid rgba(244, 154, 85, 0.25);
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(244, 154, 85, 0.08) 0%, rgba(10, 16, 32, 0.95) 60%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.bridge-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}

.bridge-head h3 {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.bridge-head p {
  color: var(--muted, #a8b0c1);
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.bridge-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.bridge-metric-card {
  background: rgba(13, 21, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.1rem;
}

.bridge-metric-card span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted, #a8b0c1);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.bridge-metric-card strong {
  display: block;
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 1.35rem;
  color: #fff;
  margin: 0.3rem 0 0.15rem;
}

.bridge-metric-card small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted, #a8b0c1);
}

.bridge-shortcuts {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.1rem;
}

.bridge-route-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text, #f4f5f7);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  transition: all 0.2s;
}

.bridge-route-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold, #e2bd66);
  color: var(--gold, #e2bd66);
  transform: translateY(-1px);
}

/* ── 6. Stream Edit/Add Modal ── */
.stream-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(2, 6, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.stream-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.stream-modal-card {
  width: min(540px, 94vw);
  background: #090e1d;
  border: 1px solid rgba(226, 189, 102, 0.35);
  border-radius: 24px;
  padding: 1.8rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stream-modal-backdrop.is-open .stream-modal-card {
  transform: scale(1);
}

.stream-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.9rem;
}

.stream-modal-head h3 {
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 1.2rem;
  margin: 0;
  color: #fff;
}

.stream-modal-close {
  background: transparent;
  border: none;
  color: var(--muted, #a8b0c1);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}

.stream-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.stream-form-grid {
  display: grid;
  gap: 1rem;
}

.stream-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stream-form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #a8b0c1);
}

.stream-form-group input,
.stream-form-group select,
.stream-form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(13, 21, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
}

.stream-form-group input:focus,
.stream-form-group select:focus,
.stream-form-group textarea:focus {
  border-color: var(--gold, #e2bd66);
  box-shadow: 0 0 10px rgba(226, 189, 102, 0.25);
}

.stream-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.stream-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.btn-cancel {
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted, #a8b0c1);
  font-weight: 700;
  cursor: pointer;
}

.btn-submit {
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  background: var(--gold, #e2bd66);
  border: 1px solid var(--gold, #e2bd66);
  color: #050914;
  font-weight: 800;
  cursor: pointer;
}

.btn-submit:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px rgba(226, 189, 102, 0.4);
}

/* ── 7. Responsive Breakpoints ── */
@media (max-width: 960px) {
  .cockpit-tabs-bar {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .cockpit-tab-btn {
    padding: 0.6rem 0.85rem;
  }

  /* Switch orbit stage to responsive flowing grid */
  .revenue-orbit-stage {
    min-height: auto;
    padding: 2rem 1rem;
  }

  .orbit-ring {
    display: none;
  }

  .orbit-sun {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 2rem;
  }

  .orbit-satellites {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }

  .orbit-node {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100%;
    animation: none;
  }

  .bridge-metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .revenue-opening {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .sun-avatar-wrap {
    width: 110px;
    height: 110px;
  }

  .orbit-satellites {
    grid-template-columns: 1fr;
  }

  .stream-form-row {
    grid-template-columns: 1fr;
  }
}
