/* ==========================================================================
   AIFLEET COMMANDER - PORTAL STYLES (BIEL + GRAFIT + ANTRACYT)
   Zaawansowane Animacje Odliczania, Luksusowy Minimalizm & Styl RadarDomen
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  
  --anthracite-deep: #090d16;
  --anthracite-main: #0f172a;
  --graphite-dark: #1e293b;
  --graphite-mid: #334155;
  --graphite-muted: #64748b;
  --graphite-light: #94a3b8;
  
  --titanium-border: #e2e8f0;
  --titanium-border-hover: #cbd5e1;
  --titanium-dark-border: #334155;
  
  --emerald: #10b981;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-dark: #065f46;
  
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  
  --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-title: 'Space Grotesk', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-page);
  color: var(--anthracite-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtelna siatka techniczna w tle */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

.portal-container {
  width: 96%;
  max-width: 1540px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   NAVBAR & GŁÓWNA NAWIGACJA ZAKŁADEK
   ========================================================================== */
.portal-navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--titanium-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--anthracite-deep) 0%, var(--graphite-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  flex-shrink: 0;
}

.badge-core {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.brand-info {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  line-height: 1.15;
}

.brand-info h1 {
  font-family: var(--font-title);
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--anthracite-deep);
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.brand-info .badge-mini-tag {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  background: #0f172a;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.brand-info .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--graphite-muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
  white-space: nowrap;
}

.portal-nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--titanium-border);
  flex-shrink: 0;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--graphite-mid);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--anthracite-deep);
}

.tab-btn.active {
  background: var(--anthracite-deep);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.storage-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--titanium-border);
  color: var(--graphite-dark);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--emerald-dark);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   SUBHEADER / HERO BAR
   ========================================================================== */
.portal-subheader {
  margin-top: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.subheader-title-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mission-control-inline-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 9999px;
}

.subheader-title h2 {
  font-family: var(--font-title);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 900;
  color: var(--anthracite-deep);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.subheader-title p {
  font-size: 0.84rem;
  color: var(--graphite-muted);
  margin-top: 2px;
}

.header-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-titanium {
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  color: var(--anthracite-deep);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-titanium:hover {
  background: var(--bg-subtle);
  border-color: var(--anthracite-deep);
}

.btn-primary-dark {
  background: var(--anthracite-deep);
  border: none;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary-dark:hover {
  background: var(--graphite-dark);
  transform: translateY(-1px);
}

/* ==========================================================================
   TAB 1: CENTRUM DOWODZENIA (DASHBOARD)
   ========================================================================== */
.tab-content-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.tab-content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ROW 1: 6 KPI Stat Cards with Sparklines */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-box {
  background: var(--bg-card);
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.kpi-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--titanium-border-hover);
}

.kpi-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.kpi-label {
  font-family: var(--font-title);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--graphite-muted);
  letter-spacing: 0.05em;
}

.kpi-num-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}

.kpi-big {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--anthracite-deep);
  line-height: 1;
}

.kpi-unit {
  font-size: 0.8rem;
  color: var(--graphite-light);
  font-weight: 700;
}

.kpi-subtext {
  font-size: 0.7rem;
  color: var(--graphite-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.kpi-spark {
  height: 22px;
  width: 100%;
}

.kpi-spark svg {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   ANIMACJE ODLICZANIA (COUNTDOWN ANIMATIONS & SHOWCASE)
   ========================================================================== */
.countdown-showcase-row {
  background: var(--bg-card);
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.showcase-left-info {
  flex: 1;
}

.showcase-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.badge-pulse-timer {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* Pigułka pomocy "ℹ️ Jak to działa?" oraz wyskakujący dymek */
.info-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-help-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid var(--titanium-border);
  color: var(--graphite-dark);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.info-help-pill:hover,
.info-help-pill.active {
  background: var(--anthracite-deep);
  color: #ffffff;
  border-color: var(--anthracite-deep);
}

.pill-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--anthracite-deep);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 0.62rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

.info-help-pill:hover .pill-info-icon,
.info-help-pill.active .pill-info-icon {
  background: #ffffff;
  color: var(--anthracite-deep);
}

.info-tooltip-btn {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--titanium-border);
  color: var(--graphite-muted);
  font-family: var(--font-title);
  font-size: 0.6rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
  text-transform: lowercase;
}

.info-tooltip-btn:hover,
.info-tooltip-btn.active {
  background: var(--anthracite-deep);
  color: #ffffff;
  border-color: var(--anthracite-deep);
  transform: scale(1.08);
}

.info-tooltip-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.25), 0 4px 12px rgba(15, 23, 42, 0.08);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Pokazywanie na hover (desktop) lub po dodaniu klasy .active (mobile click) */
.info-tooltip-wrapper:hover .info-tooltip-popup,
.info-tooltip-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.info-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.info-tooltip-head strong {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--anthracite-deep);
  flex: 1;
}

.info-tooltip-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--graphite-muted);
  cursor: pointer;
  display: none;
}

.info-tooltip-popup.is-open .info-tooltip-close {
  display: block;
}

.info-tooltip-popup p {
  font-size: 0.76rem;
  line-height: 1.45;
  color: #334155;
  margin: 0 0 8px 0;
}

.info-tooltip-popup ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-tooltip-popup li {
  font-size: 0.72rem;
  line-height: 1.4;
  color: #475569;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.info-tooltip-popup li code {
  font-family: var(--font-mono);
  background: #ffffff;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #065f46;
}

.showcase-left-info h3 {
  font-family: var(--font-title);
  font-size: 1.28rem;
  font-weight: 900;
  color: var(--anthracite-deep);
  line-height: 1.2;
}

.showcase-left-info p {
  color: var(--graphite-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

/* Animowany Zegar Cyfrowy Odometer / Flip Card */
.digital-countdown-display {
  display: flex;
  gap: 10px;
  align-items: center;
}

.flip-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flip-card {
  width: 66px;
  height: 50px;
  background: linear-gradient(180deg, var(--anthracite-deep) 0%, var(--graphite-dark) 100%);
  border: 1.5px solid #334155;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
  position: relative;
  overflow: hidden;
}

.flip-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.flip-number {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.flip-card.pulse-active .flip-number {
  animation: glow-number 1s infinite alternate;
}

@keyframes glow-number {
  0% { color: #ffffff; text-shadow: none; }
  100% { color: var(--emerald); text-shadow: 0 0 10px var(--emerald); }
}

.flip-label {
  font-family: var(--font-title);
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--graphite-muted);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.flip-colon {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--graphite-light);
  margin-top: -14px;
}

/* Animowany Ring Kołowy (SVG Circular Countdown Dial) */
.circular-dial-wrap {
  width: 84px;
  height: 84px;
  position: relative;
  flex-shrink: 0;
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-track {
  fill: none;
  stroke: var(--titanium-border);
  stroke-width: 9;
}

.dial-progress {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.dial-progress.cooling {
  stroke: var(--amber);
}

.dial-center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dial-center-content strong {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--anthracite-deep);
  line-height: 1;
}

.dial-center-content small {
  font-size: 0.62rem;
  color: var(--graphite-muted);
  font-weight: 700;
  margin-top: 2px;
}

/* ROW 2: RADAR ORBITALNY + SMART ROUTER DISPATCH */
.middle-cockpit-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.orbital-radar-box, .smart-router-box {
  background: var(--bg-card);
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.smart-router-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Radar Orbitalny */
.radar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.radar-head h4 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--anthracite-deep);
}

.orbital-center-circle {
  width: 276px;
  height: 276px;
  border-radius: 50%;
  border: 2px dashed var(--titanium-border-hover);
  margin: 18px auto 22px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, rgba(248, 250, 252, 0.6) 70%);
}

.orbital-center-circle::before {
  content: '';
  position: absolute;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 1px dashed #cbd5e1;
  pointer-events: none;
}

.orbit-core {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--anthracite-deep) 0%, var(--graphite-dark) 100%);
  border: 3px solid #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  user-select: none;
}

.orbit-core .num {
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.orbit-core .desc {
  font-size: 0.56rem;
  font-weight: 800;
  color: var(--emerald);
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.orbit-core .core-action-hint {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 9999px;
  margin-top: 5px;
  transition: all 0.2s ease;
}

.orbit-core:hover .core-action-hint {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.35);
}

/* Smart Router (Prawy panel) */
.tool-select-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.ai-select-pill {
  border: 1.5px solid var(--titanium-border);
  background: #ffffff;
  color: var(--graphite-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-select-pill:hover {
  background: var(--bg-subtle);
  border-color: var(--anthracite-deep);
}

.ai-select-pill.active {
  background: var(--anthracite-deep);
  color: #ffffff;
  border-color: var(--anthracite-deep);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.target-hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid var(--anthracite-deep);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  margin-bottom: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.hero-top-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-meta-header {
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--graphite-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0;
  flex-wrap: wrap;
}

.hero-email-row h3 {
  font-family: var(--font-main);
  font-size: clamp(1.2rem, 1.85vw, 1.65rem);
  font-weight: 800;
  color: var(--anthracite-deep);
  letter-spacing: -0.01em;
  word-break: break-all;
}

.status-tag {
  font-family: var(--font-title);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}
.tag-ready { background: var(--emerald-bg); color: var(--emerald-dark); border: 1.5px solid var(--emerald-border); }
.tag-cooling { background: var(--amber-bg); color: #92400e; border: 1.5px solid var(--amber-border); }

.hero-sub-props {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.prop-chip {
  font-family: var(--font-main);
  font-size: 0.75rem;
  color: var(--graphite-mid);
  background: var(--bg-subtle);
  border: 1px solid var(--titanium-border);
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 600;
}

.prop-chip-promo {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
  transition: all 0.15s ease;
}

.prop-chip-promo:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

/* Pasek wszystkich 7 silników dla wybranego konta w Inspektorze */
.hero-account-tools-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

@media (max-width: 900px) {
  .hero-account-tools-strip {
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  }
}

.hero-tool-mini-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.hero-tool-mini-btn:hover {
  transform: translateY(-1px);
  border-color: var(--anthracite-deep);
}

.hero-tool-mini-btn.mini-free {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.hero-tool-mini-btn.mini-working {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: #34d399;
  color: #ffffff;
  animation: slot-working-blink 1.3s infinite ease-in-out;
}

.hero-tool-mini-btn.mini-cooling {
  background: #fffbeb;
  border-color: #fde68a;
}

.hero-tool-mini-btn.mini-active-focus {
  box-shadow: 0 0 0 2px var(--anthracite-deep);
}

.hero-tool-mini-name {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--graphite-dark);
  text-transform: uppercase;
  line-height: 1.1;
}

.hero-tool-mini-btn.mini-working .hero-tool-mini-name,
.hero-tool-mini-btn.mini-working .hero-tool-mini-state {
  color: #ffffff;
}

.hero-tool-mini-state {
  font-size: 0.65rem;
  font-weight: 800;
  margin-top: 2px;
  color: #059669;
}

.hero-tool-mini-btn.mini-cooling .hero-tool-mini-state {
  color: #b45309;
}

/* Szybki podgląd ważnych kont we flocie (W użyciu + Promocje + Blokady) */
.fleet-highlights-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
}

.fleet-highlights-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.66rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.fleet-highlights-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 82px;
  overflow-y: auto;
}

.highlight-acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 700;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--anthracite-deep);
  cursor: pointer;
  transition: all 0.15s ease;
}

.highlight-acc-pill:hover {
  border-color: var(--anthracite-deep);
  background: #f1f5f9;
}

.highlight-acc-pill.hl-selected {
  border-color: var(--anthracite-deep);
  box-shadow: 0 0 0 1.5px var(--anthracite-deep);
}

.highlight-acc-pill.hl-working {
  background: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
}

.highlight-acc-pill.hl-promo {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.highlight-acc-pill.hl-cooling {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.highlight-tag {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.07);
}

.router-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   MATRIX TABLE (PEŁNA TABELA FLOTY)
   ========================================================================== */
.matrix-section-box {
  background: var(--bg-card);
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.matrix-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.matrix-header-bar h4 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--anthracite-deep);
}

.matrix-filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.matrix-edit-hint {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}

.matrix-filter-pills {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  gap: 2px;
}

.matrix-filter-pills .period-btn {
  background: transparent;
  color: #64748b;
  border: none;
  border-radius: 9999px;
  padding: 5px 13px;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-filter-pills .period-btn:hover {
  color: var(--anthracite-deep);
}

.matrix-filter-pills .period-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.table-wrap {
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: center;
}

.portal-table thead {
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--titanium-border);
}

.portal-table th {
  padding: 11px 10px;
  font-family: var(--font-title);
  font-size: 0.73rem;
  font-weight: 900;
  color: var(--graphite-dark);
  letter-spacing: 0.04em;
  text-align: center;
  vertical-align: middle;
}

.portal-table th.th-left,
.portal-table td:nth-child(2) {
  text-align: left;
}

.portal-table th .th-sub {
  font-size: 0.52em;
  font-weight: 700;
  color: #64748b;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  vertical-align: middle;
  margin-left: 2px;
}

.portal-table tbody tr {
  border-bottom: 1px solid var(--titanium-border);
  transition: background 0.15s ease;
}

.portal-table tbody tr:hover {
  background: #f8fafc;
}

.portal-table td {
  padding: 10px 10px;
  vertical-align: middle;
  text-align: center;
}

.node-number {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--anthracite-deep);
  background: var(--bg-subtle);
  border: 1px solid var(--titanium-border);
  padding: 4px 8px;
  border-radius: 6px;
}

.account-col-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.acc-email {
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--anthracite-deep);
  cursor: pointer;
}
.acc-email:hover {
  color: var(--blue);
  text-decoration: underline;
}

.acc-prof {
  font-family: var(--font-main);
  font-size: 0.73rem;
  color: var(--graphite-light);
  font-weight: 600;
}

.acc-prof.acc-prof-promo {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 700;
  margin-top: 2px;
}

/* Przycisk i Badge Slotu AI w Tabeli */
.slot-trigger-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease;
}

.slot-badge:hover {
  transform: scale(1.06);
}

.slot-free {
  background: var(--bg-subtle);
  color: var(--graphite-muted);
  border: 1.5px solid var(--titanium-border-hover);
}

/* Stan ODNOWIONE (po wyzerowaniu licznika, do pierwszego kliknięcia) - MRUGAJĄCY ZIELONY */
.slot-renewed {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #ffffff;
  border: 1.5px solid #4ade80;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.6);
  animation: slot-renewed-blink 1.1s infinite ease-in-out;
  letter-spacing: 0.03em;
}

@keyframes slot-renewed-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.8), 0 0 0 2px rgba(74, 222, 128, 0.55);
  }
  50% {
    opacity: 0.42;
    transform: scale(0.96);
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.2), 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

/* Stan W UŻYCIU / TERAZ PRACUJĘ - PULSUJĄCY BLINK GLOW */
.slot-working {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff !important;
  border: 1.5px solid #34d399 !important;
  font-weight: 900 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.35);
  animation: slot-working-blink 1.25s infinite ease-in-out;
  letter-spacing: 0.04em;
}

@keyframes slot-working-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.8), 0 0 0 2px rgba(52, 211, 153, 0.55);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.96);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.2), 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

/* Przycisk "Teraz pracuję" w pasku Inspektora */
.btn-work-toggle-inspector {
  position: relative;
  border-color: #10b981;
  color: #065f46;
  background: #f0fdf4;
  font-weight: 800;
  transition: all 0.2s ease;
}

.btn-work-toggle-inspector:hover {
  background: #dcfce7;
  border-color: #059669;
  color: #064e3b;
  transform: translateY(-1px);
}

.btn-work-toggle-inspector.active-working {
  background: linear-gradient(135deg, #065f46 0%, #059669 100%) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6) !important;
  animation: slot-working-blink 1.5s infinite ease-in-out;
}

.work-pulse-led-sm {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
  animation: led-blink 1s infinite alternate;
}

.btn-work-toggle-inspector.active-working .work-pulse-led-sm {
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

@keyframes led-blink {
  0% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* Karta Główna "Teraz Pracuję" w Modalu Cooldown */
.working-mode-hero-box {
  margin-bottom: 14px;
}

/* === DUO ROW: Teraz pracuję + Odblokuj 100% obok siebie === */
.quick-duo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.btn-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  text-align: center;
  white-space: nowrap;
}

.btn-duo-blink {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  color: #064e3b;
}

.btn-duo-blink:hover {
  border-color: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-duo-blink.is-working {
  background: linear-gradient(135deg, #065f46 0%, #059669 100%);
  border-color: #34d399;
  color: #ffffff;
  animation: slot-working-blink 1.5s infinite ease-in-out;
}

.btn-duo-blink.is-working .duo-led {
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

.btn-duo-blink.is-working .duo-badge {
  background: #dc2626;
}

.duo-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: led-blink 1s infinite alternate;
  flex-shrink: 0;
}

.duo-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 9999px;
  background: #10b981;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.btn-duo-unlock {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #a7f3d0;
  color: #065f46;
  font-size: 0.80rem;
  grid-column: auto;
  padding: 12px 14px;
}

.btn-duo-unlock:hover {
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

@media (max-width: 480px) {
  .quick-duo-row {
    grid-template-columns: 1fr;
  }
}

.slot-cooling {
  background: var(--amber-bg);
  color: #92400e;
  border: 1.5px solid var(--amber-border);
  font-family: var(--font-mono);
  animation: pulse-cooling 2s infinite ease-in-out;
}

@keyframes pulse-cooling {
  0%, 100% { border-color: var(--amber-border); }
  50% { border-color: var(--amber); }
}

.slot-long-cool {
  background: var(--amber-bg);
  color: #92400e;
  border: 1.5px solid var(--amber-border);
  font-family: var(--font-mono);
  font-weight: 900;
  animation: pulse-cooling 2s infinite ease-in-out;
}

/* ==========================================================================
   TAB 2: MENEDŻER KONT (CRUD & BULK IMPORT)
   ========================================================================== */
.manager-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  margin-bottom: 30px;
}

.form-card-box {
  background: var(--bg-card);
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.form-card-box h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--anthracite-deep);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--graphite-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--anthracite-deep);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ==========================================================================
   MODAL DIALOG (WŁASNY COOLDOWN 3d 13h)
   ========================================================================== */
.modal-overlay-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay-backdrop.active {
  display: flex;
}

.modal-content-box {
  background: #ffffff;
  border: 2px solid var(--anthracite-deep);
  border-radius: var(--radius-md);
  width: 92%;
  max-width: 440px;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1.5px solid var(--titanium-border);
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-head h4 {
  font-family: var(--font-title);
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--anthracite-deep);
  line-height: 1.3;
}

.modal-close-x {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--graphite-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-time-steppers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 6px;
  align-items: flex-end;
  background: var(--bg-subtle);
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 0;
}

/* Wybór daty w kalendarzu w modalu cooldownu - kompaktowy */
.calendar-picker-box {
  background: #f8fafc;
  border: 1.5px solid var(--titanium-border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
}

.cal-picker-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--graphite-muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.cal-picker-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: flex-end;
}

.cal-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cal-sub-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--graphite-mid);
}

.cal-date-input,
.cal-time-input {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 8px;
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  border-radius: 6px;
  color: var(--anthracite-main);
  outline: none;
  cursor: pointer;
  width: 100%;
  height: 34px;
}

.cal-date-input:focus,
.cal-time-input:focus {
  border-color: var(--anthracite-deep);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.cal-picker-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: #059669;
  font-family: var(--font-mono);
  margin-top: 4px;
  min-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-picker-hint.error {
  color: #dc2626;
}

.stepper-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stepper-field span {
  font-family: var(--font-title);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--graphite-muted);
}

.input-num {
  padding: 6px;
  text-align: center;
  border: 1.5px solid var(--titanium-border);
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.8rem;
  height: 34px;
}

.preset-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.preset-action-btn {
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--anthracite-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.preset-action-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--anthracite-deep);
}

.preset-action-btn.star-highlight {
  grid-column: span 2;
  text-align: center;
  background: var(--bg-subtle);
  border: 1.5px solid var(--anthracite-deep);
  color: var(--anthracite-deep);
  padding: 8px 10px;
}

.preset-action-btn.green-unlock {
  grid-column: span 2;
  text-align: center;
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald-dark);
  padding: 8px 10px;
}

/* Blokada kłódką przed przypadkowym kliknięciem i zmianą */
.cooldown-lock-container {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--titanium-border);
}

.btn-lock-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-lock-toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-lock-toggle.is-locked {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
}

.lock-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.lock-text-group {
  flex: 1 1 auto;
  min-width: 0;
}

.lock-text-group strong {
  display: block;
  font-size: 0.76rem;
  color: var(--anthracite-main);
  font-family: var(--font-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lock-text-group small {
  display: block;
  font-size: 0.65rem;
  color: var(--graphite-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lock-badge-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--titanium-border);
  color: var(--graphite-mid);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.btn-lock-toggle.is-locked .lock-badge-pill {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}

/* Wizualna kłódka w tabeli głównej floty */
.slot-badge.slot-locked {
  border-style: dashed;
  box-shadow: 0 0 0 1px #f59e0b;
}

.slot-lock-indicator {
  display: inline-block;
  font-size: 0.72rem;
  margin-left: 3px;
  color: #d97706;
}

/* Wygaszanie pól edycji w modalu gdy slot jest zablokowany */
.modal-controls-locked {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.5);
  transition: opacity 0.2s ease;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
/* ==========================================================================
   ROZSZERZENIA: INTERAKTYWNA PĘTLA ORBITALNA, MINI-MATRIX I EDYTOR NARZĘDZI
   ========================================================================== */

/* 1. Interaktywna Pętla Orbitalna, 5-etapowy Pipeline i Skaner Radaru */
.loop-stage-pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-full);
  padding: 5px 8px;
  margin-bottom: 12px;
  gap: 2px;
}

.loop-stage-step {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--graphite-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.loop-stage-step:hover {
  color: var(--anthracite-deep);
  background: #ffffff;
  border-color: var(--titanium-border);
}

.loop-stage-step.active {
  background: var(--anthracite-deep);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.loop-stage-step .stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.loop-stage-step.active .stage-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.stage-arrow {
  font-size: 0.7rem;
  color: #cbd5e1;
  font-weight: 900;
  user-select: none;
}

.radar-scanner-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg, rgba(16, 185, 129, 0.28) 0deg, rgba(16, 185, 129, 0.05) 55deg, transparent 90deg);
  animation: radarOrbitSweep 6s linear infinite;
  z-index: 1;
}

@keyframes radarOrbitSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-sweep-paused {
  animation-play-state: paused;
}

.orbital-center-circle {
  overflow: visible !important;
}

.orbital-accounts-ring,
.orbital-satellites-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Zewnętrzny pierścień 15 węzłów kont (#01 - #15) */
.orbital-acc-node {
  position: absolute;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #10b981;
  color: var(--anthracite-deep);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, box-shadow 0.18s ease;
  z-index: 4;
  user-select: none;
}

.orbital-acc-node:hover {
  transform: scale(1.26);
  background: var(--anthracite-deep);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
  z-index: 6;
}

.orbital-acc-node.cooling {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.orbital-acc-node.working {
  border-color: #34d399 !important;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.9) !important;
  animation: slot-working-blink 1.25s infinite ease-in-out !important;
  z-index: 7 !important;
}

.orbital-acc-node.selected,
.orbital-acc-node.recommended {
  background: var(--anthracite-deep);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.32);
  transform: scale(1.15);
  z-index: 5;
}

.orbital-acc-node.scan-ping {
  background: #10b981 !important;
  color: #ffffff !important;
  transform: scale(1.32) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.85) !important;
}

/* Wewnętrzny pierścień 7 satelitów narzędzi AI */
.orbital-tool-sat {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
  z-index: 3;
  user-select: none;
}

.orbital-tool-sat:hover {
  transform: scale(1.25);
  border-color: var(--anthracite-deep);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
  z-index: 6;
}

.orbital-tool-sat.active {
  background: var(--anthracite-deep);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}

.orbital-tool-sat .sat-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
}

.orbital-tool-sat.cooling .sat-pulse-dot {
  background: #f59e0b;
}

.orbit-core {
  position: relative;
  z-index: 4;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.orbit-core:hover {
  transform: scale(1.05);
  border-color: #10b981;
}

.orbit-core:active {
  transform: scale(0.97);
}

/* Dolny pasek Inspektora: Przyciski po lewej + 4 Kafelki Telemetrii po prawej */
.router-bottom-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.orbital-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 6px;
  margin: 0;
}

.orbit-metric-btn {
  background: #f8fafc;
  border: 1.5px solid var(--titanium-border);
  border-radius: 8px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.orbit-metric-btn:hover {
  background: #ffffff;
  border-color: var(--anthracite-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.orbit-metric-btn strong {
  font-family: var(--font-title);
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--anthracite-deep);
  line-height: 1.1;
}

.orbit-metric-btn small {
  font-size: 0.54rem;
  font-weight: 800;
  color: var(--graphite-muted);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.next-renewal-ticker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--graphite-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--titanium-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.next-renewal-ticker:hover {
  border-color: var(--anthracite-deep);
  background: #ffffff;
}

.loop-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-scan-loop {
  background: var(--anthracite-deep);
  color: #ffffff;
  border: 1px solid #334155;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-scan-loop:hover {
  background: var(--graphite-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

/* 2. Mini-Matrix 15 Węzłów zintegrowana z tabelą floty na dole */
.fleet-mini-matrix-box {
  background: #f8fafc;
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.mini-matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--graphite-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
}

@media (max-width: 900px) {
  .mini-matrix-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 600px) {
  .mini-matrix-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mini-node-chip {
  background: #ffffff;
  border: 1.5px solid var(--titanium-border);
  border-radius: 8px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
}

.mini-node-chip:hover {
  border-color: var(--anthracite-deep);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.mini-node-chip.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.mini-node-chip.recommended {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.mini-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-node-num {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 0.74rem;
  color: var(--anthracite-deep);
}

.mini-node-badge {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.mini-node-badge.ready {
  background: #d1fae5;
  color: #065f46;
}

.mini-node-badge.cooling {
  background: #fef3c7;
  color: #92400e;
}

.mini-node-dots {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.mini-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
}

.mini-dot.cooling {
  background: #f59e0b;
}

/* 3. Karty Silników AI (Tab 3) & Edytor */
.service-config-card {
  background: var(--bg-card);
  border: 1.5px solid var(--titanium-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.service-config-card:hover {
  border-color: var(--titanium-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.srv-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.srv-card-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-subtle);
  border: 1px solid var(--titanium-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.srv-card-url-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #334155;
  margin: 10px 0;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.srv-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* 4. Globalny Toast Pływający */
.portal-toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--anthracite-deep);
  color: #ffffff;
  border: 1px solid #334155;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 36px);
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-toast.active {
  display: flex;
}

@keyframes toastSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSYWNOŚĆ & ZOPTYMALIZOWANE PADDINGI MOBILNE (TABLET & SMARTFON)
   ========================================================================== */
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .middle-cockpit-grid { grid-template-columns: 1fr; }
  .manager-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .portal-container {
    width: 96%;
  }

  .portal-navbar {
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .nav-brand {
    justify-content: space-between;
  }

  .portal-nav-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 3px;
    scrollbar-width: none;
  }
  .portal-nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 6px 11px;
    font-size: 0.76rem;
    flex: 0 0 auto;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }

  .portal-subheader {
    margin-top: 12px;
    margin-bottom: 12px;
    gap: 10px;
  }

  .subheader-title h2 {
    font-size: 1.35rem;
  }

  .subheader-title p {
    font-size: 0.8rem;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .kpi-box {
    padding: 10px 12px;
  }

  .kpi-big {
    font-size: 1.4rem;
  }

  .countdown-showcase-row {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 14px 12px;
    gap: 12px;
    margin-bottom: 12px;
  }

  .showcase-title-row {
    justify-content: center;
    flex-wrap: wrap;
  }

  .info-tooltip-popup {
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    width: min(300px, calc(100vw - 32px));
    text-align: left;
  }

  .info-tooltip-wrapper:hover .info-tooltip-popup,
  .info-tooltip-popup.is-open {
    transform: translateX(-50%) translateY(0);
  }

  .showcase-left-info h3 {
    font-size: 1.15rem;
  }

  .digital-countdown-display {
    justify-content: center;
    gap: 6px;
  }

  .flip-card {
    width: 54px;
    height: 48px;
  }

  .flip-number {
    font-size: 1.35rem;
  }

  .flip-colon {
    font-size: 1.3rem;
  }

  .circular-dial-wrap {
    width: 90px;
    height: 90px;
    margin: 0 auto;
  }

  .orbital-radar-box,
  .smart-router-box,
  .matrix-section-box,
  .form-card-box,
  .service-config-card {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .loop-stage-pipeline {
    overflow-x: auto;
    padding: 4px 6px;
    scrollbar-width: none;
  }

  .loop-stage-step {
    padding: 4px 8px;
    font-size: 0.68rem;
    flex-shrink: 0;
  }

  .target-hero-card {
    padding: 16px 14px;
    margin-bottom: 12px;
  }

  .hero-email-row {
    gap: 8px;
    margin: 8px 0 10px 0;
  }

  .hero-email-row h3 {
    font-size: 1.18rem;
  }

  .router-bottom-split {
    flex-direction: column;
    align-items: stretch;
  }

  .orbital-telemetry-strip {
    width: 100%;
  }

  .router-actions-row .btn-primary-dark,
  .router-actions-row .btn-titanium {
    flex: 1 1 100%;
    justify-content: center;
  }

  .portal-table th,
  .portal-table td {
    padding: 8px 8px;
    font-size: 0.76rem;
  }

  .modal-content-box {
    width: 95%;
    max-width: 360px;
    margin: 8px auto;
  }

  .modal-head {
    padding: 10px 14px;
  }

  .modal-head h4 {
    font-size: 0.86rem;
  }

  .modal-body {
    padding: 10px 12px;
  }

  .custom-time-steppers {
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 4px;
    padding: 6px 8px;
  }

  .custom-time-steppers .btn-primary-dark {
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .cal-picker-row {
    display: grid;
    grid-template-columns: 1fr 78px auto;
    gap: 4px;
    align-items: flex-end;
  }

  .cal-picker-row .btn-primary-dark {
    padding: 6px 8px;
    font-size: 0.72rem;
    height: 32px;
  }

  .cal-date-input,
  .cal-time-input {
    height: 32px;
    padding: 4px 6px;
    font-size: 0.74rem;
  }

  .preset-pill-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .preset-action-btn {
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .preset-action-btn.star-highlight,
  .preset-action-btn.green-unlock {
    grid-column: span 2;
    padding: 7px 8px;
  }
}

@media (max-width: 420px) {
  .orbital-center-circle {
    transform: scale(0.9);
    margin: 6px auto 10px auto;
  }

  .flip-card {
    width: 48px;
    height: 44px;
  }

  .flip-number {
    font-size: 1.2rem;
  }
}
